next up previous contents
Next: References Up: Volrend User's Guide and Previous: tclcmd

Matrix class

The matrix class defines a dense matrix data type with the usual matrix operations. Below is the public interface that is already defined.

class matrix
{
 public:
  matrix();
  matrix(int rows, int cols=1);
  matrix(int rows, int cols, double *data)
  ~matrix(); 
  matrix(const matrix& x);

  matrix& operator=(matrix& x);

  double& operator()(int i,int j=0); /* element subscripting */
  matrix operator+(matrix &x);
  matrix operator-(matrix &x);
  matrix operator-();
  matrix operator*(matrix &x);
  matrix transpose();
  matrix apply(double (*f)(double)); /* apply function elementwise */
};



Russell Standish
Mon Feb 20 17:13:01 EST 1995