Matrix  0.1.0
Easy-to-use Scientific Computing library in/for C++
MatrixOp Class Reference

#include <matrix_operations.hpp>

Public Member Functions

Matrix init (std::vector< std::vector< double >>)
 Method to initialize values of a Matrix object using a 2D vector. More...
 
Matrix init (std::vector< std::vector< std::string >>)
 Method to initialize values of a Matrix object using a 2D vector. More...
 
Matrix concatenate (Matrix, Matrix, std::string)
 Method to concatenate/join two Matrix objects. More...
 
Matrix matmul (Matrix, Matrix)
 Method to calculate matrix multiplication. More...
 
Matrix zeros (int, int)
 Method to create an Matrix of all elements 0. More...
 
Matrix ones (int, int)
 Method to create an Matrix of all elements 1. More...
 
Matrix eye (int)
 Method to create an identity Matrix. More...
 
double determinant (Matrix, int)
 Method to calculate the Determinant of a Matrix. More...
 
Matrix inverse (Matrix)
 Method to calculate the Inverse of a Matrix. More...
 
Matrix sum (Matrix, std::string)
 Method to calculate the sum over an axis of a Matrix. More...
 
Matrix mean (Matrix, std::string)
 Method to calculate the mean over an axis of a Matrix. More...
 
Matrix std (Matrix, std::string)
 Method to calculate the standard deviation over an axis of a Matrix. More...
 
Matrix min (Matrix, std::string)
 Method to get the minimum value along an axis. More...
 
Matrix max (Matrix, std::string)
 Method to get the maximum value along an axis. More...
 
Matrix argmin (Matrix, std::string)
 Method to get the index of minimum value along an axis. More...
 
Matrix argmax (Matrix, std::string)
 Method to get the index of maximum value along an axis. More...
 
Matrix sqrt (Matrix)
 
Matrix power (Matrix, Matrix)
 
Matrix power (Matrix, double)
 
Matrix slice_select (Matrix, Matrix, double, int)
 In Y, find list of indices of element whose value is val, then return the col'th column of the Matrix containing elements of those indices. More...
 
Matrix delete_ (Matrix, int, std::string)
 Method to delete a row or column of a Matrix object. More...
 
Matrix exp (Matrix)
 Method to calculate exponential of all elements in the Matrix object. More...
 
Matrix log (Matrix)
 Method to calculate natural logarithm of all elements in the Matrix object. More...
 
Matrix abs (Matrix)
 Method to get absolute value of all elements in the Matrix object. More...
 
Matrix reciprocal (Matrix)
 Method to calculate reciprocal of all elements in the Matrix object. More...
 
Matrix genfromtxt (std::string, char)
 Method to read a csv file and return a Matrix object. More...
 

Member Function Documentation

◆ abs()

Matrix MatrixOp::abs ( Matrix  mat)

Method to get absolute value of all elements in the Matrix object.

◆ argmax()

Matrix MatrixOp::argmax ( Matrix  mat,
std::string  dim 
)

Method to get the index of maximum value along an axis.

◆ argmin()

Matrix MatrixOp::argmin ( Matrix  mat,
std::string  dim 
)

Method to get the index of minimum value along an axis.

◆ concatenate()

Matrix MatrixOp::concatenate ( Matrix  mat1,
Matrix  mat2,
std::string  dim 
)

Method to concatenate/join two Matrix objects.

◆ delete_()

Matrix MatrixOp::delete_ ( Matrix  mat,
int  index,
std::string  dim 
)

Method to delete a row or column of a Matrix object.

◆ determinant()

double MatrixOp::determinant ( Matrix  mat,
int  n 
)

Method to calculate the Determinant of a Matrix.

◆ exp()

Matrix MatrixOp::exp ( Matrix  mat)

Method to calculate exponential of all elements in the Matrix object.

◆ eye()

Matrix MatrixOp::eye ( int  size)

Method to create an identity Matrix.

◆ genfromtxt()

Matrix MatrixOp::genfromtxt ( std::string  filename,
char  delim 
)

Method to read a csv file and return a Matrix object.

◆ init() [1/2]

Matrix MatrixOp::init ( std::vector< std::vector< double >>  vec)

Method to initialize values of a Matrix object using a 2D vector.

◆ init() [2/2]

Matrix MatrixOp::init ( std::vector< std::vector< std::string >>  vec)

Method to initialize values of a Matrix object using a 2D vector.

◆ inverse()

Matrix MatrixOp::inverse ( Matrix  mat)

Method to calculate the Inverse of a Matrix.

◆ log()

Matrix MatrixOp::log ( Matrix  mat)

Method to calculate natural logarithm of all elements in the Matrix object.

◆ matmul()

Matrix MatrixOp::matmul ( Matrix  mat1,
Matrix  mat2 
)

Method to calculate matrix multiplication.

◆ max()

Matrix MatrixOp::max ( Matrix  mat,
std::string  dim 
)

Method to get the maximum value along an axis.

◆ mean()

Matrix MatrixOp::mean ( Matrix  mat,
std::string  dim 
)

Method to calculate the mean over an axis of a Matrix.

◆ min()

Matrix MatrixOp::min ( Matrix  mat,
std::string  dim 
)

Method to get the minimum value along an axis.

◆ ones()

Matrix MatrixOp::ones ( int  row,
int  col 
)

Method to create an Matrix of all elements 1.

◆ power() [1/2]

Matrix MatrixOp::power ( Matrix  mat,
double  val 
)

◆ power() [2/2]

Matrix MatrixOp::power ( Matrix  mat1,
Matrix  mat2 
)

◆ reciprocal()

Matrix MatrixOp::reciprocal ( Matrix  mat)

Method to calculate reciprocal of all elements in the Matrix object.

◆ slice_select()

Matrix MatrixOp::slice_select ( Matrix  X,
Matrix  Y,
double  val,
int  col 
)

In Y, find list of indices of element whose value is val, then return the col'th column of the Matrix containing elements of those indices.

◆ sqrt()

Matrix MatrixOp::sqrt ( Matrix  mat)

◆ std()

Matrix MatrixOp::std ( Matrix  mat,
std::string  dim 
)

Method to calculate the standard deviation over an axis of a Matrix.

◆ sum()

Matrix MatrixOp::sum ( Matrix  mat,
std::string  dim 
)

Method to calculate the sum over an axis of a Matrix.

◆ zeros()

Matrix MatrixOp::zeros ( int  row,
int  col 
)

Method to create an Matrix of all elements 0.