COOLFluiD  Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
utest-python-matrix.py
Go to the documentation of this file.
1 from coolfluid import *
2 
3 vec1=RealVector3()
4 cf_check_equal(len(vec1), 3, 'Static vector size test')
5 
6 vec2=RealVector(5)
7 cf_check_equal(len(vec2), 5, 'Dynamic vector size test')
8 
9 mat1=RealMatrix3()
10 cf_check(mat1.rows() == 3 and mat1.cols() == 3, 'Static matrix size test')
11 
12 mat2=RealMatrix(5,3)
13 cf_check(mat2.rows() == 5 and mat2.cols() == 3, 'Dynamic matrix size test')
14 
15 vec1[0]=1.0
16 cf_check_equal(vec1[0], 1.0, 'vector assignation test')
17 
18 mat1[0,0]=1.0
19 cf_check_equal(mat1[0,0], 1.0, 'matrix assignation test')
20 
21 vec2.resize(len(vec1))
22 cf_check_equal(len(vec2), 3, 'vector resize test')
23 
24 mat2.resize(mat1.rows(),mat1.cols())
25 cf_check(mat2.rows() == 3 and mat2.cols() == 3, 'matrix resize test')
26 
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > RealMatrix
Dynamic sized matrix of Real scalars.
Definition: MatrixTypes.hpp:22
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealVector
Dynamic sized column vector.
Definition: MatrixTypes.hpp:25
def cf_check_equal(a, b)
Definition: check.py:19
def cf_check(test)
Definition: check.py:1
Eigen::Matrix< Real, 3, 3 > RealMatrix3
Fixed size 3x3 matrix.
Definition: MatrixTypes.hpp:35
Eigen::Matrix< Real, 3, 1 > RealVector3
Fixed size 3x1 column vector.
Definition: MatrixTypes.hpp:41
Send comments to:
COOLFluiD Web Admin