#include <matrices.h>
Inheritance diagram for matrix::
Public Methods | |
matrix (index m_init=0, index n_init=0, index m_delta_init=2, index n_delta_init=2) | |
matrix (index m_init, index n_init, T *A, index m_delta_init=2, index n_delta_init=2) | |
matrix (const matrix< T > &x) | |
matrix< T > & | operator= (const matrix< T > &x) |
~matrix (void) | |
index | get_m (void) const |
index | get_n (void) const |
T & | operator() (index i, index j) |
T | at (index i, index j) const |
T | access (index i, index j) const |
void | resize (index new_m=0, index new_n=0) |
vector< T > | row (index j) const |
matrix< T > | rows (vector< index > indices) const |
void | ins_row (index i) |
void | ins_row (index i, vector< T > x) |
void | join_row (vector< T > x) |
void | del_row (index i) |
void | del_rows (vector< index > indices) |
vector< T > | take_row (index i) |
matrix< T > | take_rows (vector< index > indices) |
void | add_row (index i1, index i2, T alpha) |
void | add_rows (index i1, T alpha1, index i2, T alpha2) |
void | mult_row (index i, T alpha) |
void | div_row (index i, T alpha) |
void | swap_rows (index i1, index i2) |
vector< T > | col (index j) const |
matrix< T > | cols (vector< index > indices) const |
void | ins_col (index j) |
void | ins_col (index j, vector< T > x) |
void | join_col (vector< T > x) |
void | del_col (index j) |
void | del_cols (vector< index > indices) |
vector< T > | take_col (index j) |
matrix< T > | take_cols (vector< index > indices) |
void | add_col (index j1, index j2, T alpha) |
void | add_cols (index j1, T alpha1, index j2, T alpha2) |
void | mult_col (index j, T alpha) |
void | div_col (index j, T alpha) |
void | swap_cols (index j1, index j2) |
matrix< T > | sumbatrix (vector< index > r, vector< index > c) |
matrix | operator+ () |
matrix | operator- () |
Friends | |
ostream & | operator<< (ostream &s, const matrix &x) |
istream & | operator>> (istream &s, matrix &x) |
matrix< T > | operator+ (const matrix< T > &, const matrix< T > &) |
matrix< T > | operator * (const matrix< T > &, const matrix< T > &) |
matrix< T > | operator * (T alpha, const matrix< T > &a) |
matrix< T > | operator * (const matrix< T > &a, const vector< T > &v) |
matrix< T > | operator * (const vector< T > &v, const matrix< T > &a) |
matrix< T > | transpose (const matrix< T > &a) |
int | operator== (const matrix< T > &a, const matrix< T > &b) |
int | operator!= (const matrix< T > &a, const matrix< T > &b) |
matrix< T > | diag (const vector< T > &d) |
matrix< T > | diag (T a, index m, index n) |
matrix< T > | diag (T a, index m) |
matrix< T > | eye (T a, index m, index n) |
matrix< T > | eye (T a, index m) |
matrix< T > | fill (T a, index m, index n) |
matrix< T > | fill (T a, index m) |
matrix< T > | zero (T a, index m, index n) |
matrix< T > | zero (T a, index m) |
void | pretty (ostr &s, const matrix< T > &A) |
void | print2 (ostr &s, const matrix< T > &A, const matrix< T > &B) |
void | print3 (ostr &s, const matrix< T > &A, const matrix< T > &B, const matrix< T > &C) |
istream & | operator>> (istream &s, matrix &x) |
void | print2 (ostr &s, const matrix< T > &A, const matrix< T > &B) |
void | print3 (ostr &s, const matrix< T > &A, const matrix< T > &B, const matrix< T > &C) |
Definition at line 254 of file matrices.h.
|
Constructor. Creates a matrix with m_init rows and n_init columns, initial entries are undefined. All indices begin with 0 m_delta_init, n_delta_init are increasing steps Definition at line 923 of file matrices.h. |
|
Creates a matrix with m_init rows and n_init columns and initial entries from A (in the row order).
Definition at line 935 of file matrices.h. |
|
Creates a copy of a matrix.
Definition at line 954 of file matrices.h. |
|
Destructor.
Definition at line 999 of file matrices.h. |
|
Two-dimensional subscript operator to get individual matrix elements. Without bounds checking Definition at line 1777 of file matrices.h. Referenced by matrix(), operator *(), operator+(), and operator=().
|
|
Adds to the j1-column the j2-column multiplied with alpha.
Definition at line 1540 of file matrices.h. Referenced by simplex_table::pivoting_col().
|
|
Calculates a new column as a linear combination of j1-th and j2-th columns with coefficients alpha1 and alpha2, then joins a new column to the right side of a matrix.
Definition at line 1552 of file matrices.h. |
|
Adds to the i1-row the i2-row multiplied with alpha.
Definition at line 1320 of file matrices.h. |
|
Calculates a new row as a linear combination of i1-th and i2-th rows with coefficients alpha1 and alpha2, then joins a new row to the bottom of a matrix.
Definition at line 1330 of file matrices.h. |
|
Two-dimensional subscript operator to get individual matrix elements.
Definition at line 1013 of file matrices.h. Referenced by cols(), simplex_table::find_generating_row(), simplex_table::find_generating_row_mip(), simplex_table::find_pivot_col(), simplex_table::find_pivot_row(), simplex_table::gomory1(), simplex_table::gomory2(), simplex_table::pivoting_col(), pretty(), print2(), print3(), and rows().
|
|
Returns the j-th column.
Definition at line 1383 of file matrices.h. Referenced by take_col().
|
|
Returns a matrix composed from columns with numbers indices.
Definition at line 1399 of file matrices.h. Referenced by take_cols().
|
|
Deletes j-th column.
Definition at line 1482 of file matrices.h. |
|
Deletes columns.
Definition at line 1502 of file matrices.h. Referenced by take_cols().
|
|
Deletes i-th row.
Definition at line 1224 of file matrices.h. Referenced by simplex_table::gomory1(), and simplex_table::gomory2().
|
|
Deletes rows with numbers indices.
Definition at line 1244 of file matrices.h. |
|
Divides the j-th column with scalar alpha.
Definition at line 1585 of file matrices.h. Referenced by simplex_table::pivoting_col().
|
|
Divides the i-th row with scalar alpha.
Definition at line 1360 of file matrices.h. |
|
Returns the number of rows.
Definition at line 286 of file matrices.h. Referenced by det(), det_int(), simplex_table::get_rows(), inv(), matrix(), operator *(), operator+(), operator=(), operator==(), operator>>(), pretty(), print2(), print3(), and transpose().
|
|
Returns the number of columns.
Definition at line 288 of file matrices.h. Referenced by det(), det_int(), simplex_table::get_cols(), inv(), matrix(), operator *(), operator+(), operator=(), operator==(), operator>>(), pretty(), print2(), print3(), and transpose().
|
|
Inserts new column x.
Definition at line 1456 of file matrices.h. |
|
Inserts new column.
Definition at line 1410 of file matrices.h. Referenced by add_cols(), ins_col(), and join_col().
|
|
Inserts a row x.
Definition at line 1164 of file matrices.h. |
|
Inserts i-th row.
Definition at line 1140 of file matrices.h. Referenced by add_rows(), simplex_table::gomory1(), simplex_table::gomory2(), ins_row(), and join_row().
|
|
ins_col(get_n(), x) makes the same.
Definition at line 1476 of file matrices.h. |
|
ins_row(get_m(), x) makes the same.
Definition at line 1184 of file matrices.h. Referenced by take_rows().
|
|
Multiplies the j-th column with scalar alpha.
Definition at line 1573 of file matrices.h. |
|
Multiplies the i-th row with scalar alpha.
Definition at line 1350 of file matrices.h. |
|
Two-dimensional subscript operator to get/set individual matrix elements.
Definition at line 1005 of file matrices.h. Referenced by simplex_table::gomory1(), and simplex_table::gomory2().
|
|
Unary plus.
Definition at line 385 of file matrices.h. |
|
Unary minus.
Definition at line 1639 of file matrices.h. |
|
Assignement.
Definition at line 969 of file matrices.h. |
|
Construct new new_m-by-new_n matrix. New entries are undefined Definition at line 1024 of file matrices.h. Referenced by matrix(), operator *(), operator+(), operator=(), operator>>(), and transpose().
|
|
Returns the j-th row.
Definition at line 1113 of file matrices.h. Referenced by take_row(), and take_rows().
|
|
Returns the matrix composed from the rows with numbers indices.
Definition at line 1129 of file matrices.h. |
|
Returns a submatrix compose from rows r and columns c.
Definition at line 1615 of file matrices.h. |
|
Swaps j1-th and j2-th columns.
Definition at line 1597 of file matrices.h. |
|
Swaps i1-th and i2-th rows.
Definition at line 1370 of file matrices.h. |
|
Returns j-th column deleting it from the matrix.
Definition at line 1488 of file matrices.h. Referenced by del_col().
|
|
Returns columns deleting them from the matrix.
Definition at line 1531 of file matrices.h. |
|
Deletes i-th row and return it.
Definition at line 1230 of file matrices.h. Referenced by del_row().
|
|
Returns the matrix composed from the rows with numbers indices deleting they from the matrix.
Definition at line 1275 of file matrices.h. |
|
Returns a square (m, m)-matrix with entry a on the diagonal.
Definition at line 1814 of file matrices.h. |
|
Returns an (m, n)-matrix with entry a on the diagonal.
Definition at line 1799 of file matrices.h. |
|
Returns a square diagonal matrix with entries d on the diagonal.
Definition at line 1783 of file matrices.h. |
|
Returns an identity (n, n)-matrix.
Definition at line 1826 of file matrices.h. |
|
Returns an identity (m, n)-matrix.
Definition at line 1820 of file matrices.h. |
|
Returns a (m, m)-matrix filled with scalar a.
Definition at line 1844 of file matrices.h. |
|
Returns an (m, n)-matrix filled with scalar a.
Definition at line 1832 of file matrices.h. |
|
Multiplies vector (interpreted as a row) with matrix.
|
|
Multiplies matrix with vector (interpreted as a column).
|
|
Multiplies matrix with scalar alpha.
Definition at line 1724 of file matrices.h. |
|
Matrix multiplication.
Definition at line 1672 of file matrices.h. |
|
Test for inequality.
Definition at line 1762 of file matrices.h. |
|
Addition.
Definition at line 1653 of file matrices.h. |
|
First, writes the number of rows and the number of columns. Then writes entries Definition at line 1083 of file matrices.h. |
|
Test for equality.
Definition at line 1750 of file matrices.h. |
|
Then reads entries Definition at line 1098 of file matrices.h. |
|
First, reads the number of rows and the number of columns. Then reads entries Definition at line 1098 of file matrices.h. |
|
Outputs a matrix using latex notation.
Definition at line 1887 of file matrices.h. |
|
Prints matrices in the form:. A B Definition at line 1912 of file matrices.h. |
|
Prints matrices in the form:. A B Definition at line 1912 of file matrices.h. |
|
Prints matrices in the form:. A B C Definition at line 1962 of file matrices.h. |
|
Prints matrices in the form:. A B C Definition at line 1962 of file matrices.h. |
|
Transposition.
Definition at line 1737 of file matrices.h. |
|
Returns a zero (m)-matrix.
Definition at line 1856 of file matrices.h. |
|
Returns a zero (m, n)-matrix.
Definition at line 1850 of file matrices.h. |