Scythe-1.0.3
template<typename T_type = double, matrix_order ORDER = Col, matrix_style STYLE = Concrete>
scythe::Matrix< T_type, ORDER, STYLE >::Matrix ( uint  rows,
uint  cols,
bool  fill = true,
T_type  fill_value = 0 
) [inline]

Standard constructor.

The standard constructor creates a rowsXcols Matrix, filled with zeros by default. Optionally, you can leave the Matrix uninitialized, or choose a different fill value.

Parameters:
rowsThe number of rows in the Matrix.
colsThe number of columns in the Matrix.
fillIndicates whether or not the Matrix should be initialized.
fill_valueThe scalar value to fill the Matrix with when fill == true.
See also:
Matrix()
Matrix(T_type)
Matrix(uint, uint, T_iterator)
Matrix(const std::string&)
Matrix(const Matrix&)
Matrix(const Matrix<T_type, O, S> &)
Matrix(const Matrix<S_type, O, S> &)
Matrix(const Matrix<T_type, O, S>&, uint, uint, uint, uint)
Exceptions:
scythe_alloc_error(Level 1)

Example:

#include <scythestat/matrix.h>
using namespace scythe;

int main ()
{
  // Create a 4x5 matrix of zeros
  Matrix<> A(4, 5);

  // Create an unitialized 1000x1000 matrix, in row-major order
  Matrix<double, Row> B(1000, 1000, false);

  // Create a 3x2 matrix view filled with 2s
  Matrix<double, Col, View> C(3, 2, true, 2);

  return 0;
}