MEPP2 Project
Namespaces | Functions
FEVV::Math::Vector Namespace Reference

Namespaces

 Stats
 

Functions

template<typename ElementType , int DIM>
static ElementType dot_product (const ElementType v1[DIM], const ElementType v2[DIM])
 Compute v1 * v2 scalar product. More...
 
template<typename ElementType >
static ElementType dot_product (const std::vector< ElementType > &v1, const std::vector< ElementType > &v2)
 Compute v1 * v2 scalar product. More...
 
template<typename GeometryTraits >
static GeometryTraits::Scalar dot_product (const typename GeometryTraits::Vector &v1, const typename GeometryTraits::Vector &v2, const GeometryTraits &gt)
 
template<typename ElementType , int DIM>
static std::vector< ElementType > cross_product (const ElementType v1[DIM], const ElementType v2[DIM])
 
template<typename ElementType >
static std::vector< ElementType > cross_product (const std::vector< ElementType > &v1, const std::vector< ElementType > &v2)
 Compute v1 x v2 cross product. More...
 
template<typename GeometryTraits >
static GeometryTraits::Vector cross_product (const typename GeometryTraits::Vector &v1, const typename GeometryTraits::Vector &v2, const GeometryTraits &gt)
 
template<typename ElementType , int DIM>
static std::vector< ElementType > sub (const ElementType v1[DIM], const ElementType v2[DIM])
 Compute v1 - v2 (subtraction) More...
 
template<typename ElementType >
static std::vector< ElementType > sub (const std::vector< ElementType > &v1, const std::vector< ElementType > &v2)
 Compute v1 - v2 (subtraction) More...
 
template<typename GeometryTraits >
static GeometryTraits::Vector sub (const typename GeometryTraits::Point &p1, const typename GeometryTraits::Point &p2, const GeometryTraits &gt)
 Compute p1 - p2 (subtraction) More...
 
template<typename ElementType , int DIM>
static std::vector< ElementType > add (const ElementType v1[DIM], const ElementType v2[DIM])
 Compute v1 + v2 (addition) More...
 
template<typename ElementType >
static std::vector< ElementType > add (const std::vector< ElementType > &v1, const std::vector< ElementType > &v2)
 Compute v1 + v2 (addition) More...
 
template<typename GeometryTraits >
static GeometryTraits::Point add (const typename GeometryTraits::Point &p, const typename GeometryTraits::Vector &v, const GeometryTraits &gt)
 Compute p + v (addition) More...
 
template<typename ElementType , int DIM>
static double l2_distance (const ElementType v1[DIM], const ElementType v2[DIM])
 Compute ||v1 - v2||_L2 norm (distance between v1 and v2) More...
 
template<typename ElementType , int DIM>
static double l2_distance (const ElementType v[DIM])
 Compute ||V||_L2 norm (distance between v1 and v2) More...
 
template<typename GeometryTraits >
static double l2_distance (const typename GeometryTraits::Point &p1, const typename GeometryTraits::Point &p2, const GeometryTraits &gt)
 Compute ||p1 - p2||_L2 norm (distance between p1 and p2) More...
 
template<typename ElementType >
static double l2_distance (const std::vector< ElementType > &v1, const std::vector< ElementType > &v2)
 Compute ||v1 - v2||_L2 norm (distance between v1 and v2) More...
 
template<typename GeometryTraits >
static double l2_distance (const typename GeometryTraits::Vector &v, const GeometryTraits &gt)
 Compute ||V||_L2 norm (distance between v1 and v2) More...
 
template<typename ElementType >
static double l2_distance (const std::vector< ElementType > &v)
 Compute ||V||_L2 norm (distance between v1 and v2) More...
 
template<typename GeometryTraits >
static GeometryTraits::Vector normalize (const typename GeometryTraits::Vector &v, const GeometryTraits &gt)
 
template<typename ElementType >
static bool are_collinear (const std::vector< ElementType > &v1, const std::vector< ElementType > &v2)
 Tells if 2 nD vectors are collinear or not. More...
 
template<typename GeometryTraits >
static bool are_collinear (const typename GeometryTraits::Vector &v1, const typename GeometryTraits::Vector &v2)
 
template<typename ElementType >
static bool are_aligned (const std::vector< ElementType > &p1, const std::vector< ElementType > &p2, const std::vector< ElementType > &p3)
 Tells if 3 nD points are aligned or not. More...
 
template<typename GeometryTraits >
static bool are_aligned (const typename GeometryTraits::Point &p1, const typename GeometryTraits::Point &p2, const typename GeometryTraits::Point &p3)
 
template<typename ElementType >
static std::vector< ElementType > scalar_mult (const std::vector< ElementType > &v1, ElementType coef)
 Compute v1 * coef. More...
 
template<typename GeometryTraits >
static GeometryTraits::Vector scalar_mult (const typename GeometryTraits::Vector &v, double coef, const GeometryTraits &gt)
 
template<typename ElementType , int DIM>
static double get_angle_from_unit_vectors (const ElementType v1[DIM], const ElementType v2[DIM])
 V1 and V2 must be unit vectors! More...
 
template<typename ElementType , int DIM>
static double get_angle_in_degree_from_unit_vectors (const ElementType v1[DIM], const ElementType v2[DIM])
 
template<typename ElementType >
static double get_angle_from_unit_vectors (const std::vector< ElementType > &v1, const std::vector< ElementType > &v2)
 V1 and V2 must be unit vectors! More...
 
template<typename ElementType >
static double get_angle_in_degree_from_unit_vectors (const std::vector< ElementType > &v1, const std::vector< ElementType > &v2)
 
template<class ElementType >
static double get_angle_from_non_unit_vectors (const std::vector< ElementType > &v1, const std::vector< ElementType > &v2)
 V1 and V2 does not need to be unit vectors! More...
 
template<typename ElementType >
static double get_angle_in_degree_from_non_unit_vectors (const std::vector< ElementType > &v1, const std::vector< ElementType > &v2)
 
template<class ElementType >
static double get_angle_from3positions (const std::vector< ElementType > &p1, const std::vector< ElementType > &p2, const std::vector< ElementType > &p3)
 
template<typename ElementType >
static double get_angle_in_degree_from3positions (const std::vector< ElementType > &p1, const std::vector< ElementType > &p2, const std::vector< ElementType > &p3)
 
template<typename ElementType >
static void rot_coord_sys (const std::vector< ElementType > &old_u, const std::vector< ElementType > &old_v, const std::vector< ElementType > &new_norm, std::vector< ElementType > &new_u, std::vector< ElementType > &new_v)
 
template<typename ElementType >
void proj_curv (const std::vector< ElementType > &old_u, const std::vector< ElementType > &old_v, ElementType old_ku, ElementType old_kuv, ElementType old_kv, const std::vector< ElementType > &new_u, const std::vector< ElementType > &new_v, ElementType &new_ku, ElementType &new_kuv, ElementType &new_kv)
 

Function Documentation

◆ add() [1/3]

template<typename ElementType , int DIM>
static std::vector< ElementType > FEVV::Math::Vector::add ( const ElementType  v1[DIM],
const ElementType  v2[DIM] 
)
static

Compute v1 + v2 (addition)

Definition at line 548 of file MatrixOperations.hpp.

Here is the caller graph for this function:

◆ add() [2/3]

template<typename ElementType >
static std::vector< ElementType > FEVV::Math::Vector::add ( const std::vector< ElementType > &  v1,
const std::vector< ElementType > &  v2 
)
static

Compute v1 + v2 (addition)

Definition at line 561 of file MatrixOperations.hpp.

◆ add() [3/3]

template<typename GeometryTraits >
static GeometryTraits::Point FEVV::Math::Vector::add ( const typename GeometryTraits::Point p,
const typename GeometryTraits::Vector v,
const GeometryTraits &  gt 
)
static

Compute p + v (addition)

Definition at line 578 of file MatrixOperations.hpp.

◆ are_aligned() [1/2]

template<typename ElementType >
static bool FEVV::Math::Vector::are_aligned ( const std::vector< ElementType > &  p1,
const std::vector< ElementType > &  p2,
const std::vector< ElementType > &  p3 
)
static

Tells if 3 nD points are aligned or not.

Parameters
p2the central point

Definition at line 691 of file MatrixOperations.hpp.

Here is the caller graph for this function:

◆ are_aligned() [2/2]

template<typename GeometryTraits >
static bool FEVV::Math::Vector::are_aligned ( const typename GeometryTraits::Point p1,
const typename GeometryTraits::Point p2,
const typename GeometryTraits::Point p3 
)
static
Parameters
p2the central point

Definition at line 701 of file MatrixOperations.hpp.

Here is the call graph for this function:

◆ are_collinear() [1/2]

template<typename ElementType >
static bool FEVV::Math::Vector::are_collinear ( const std::vector< ElementType > &  v1,
const std::vector< ElementType > &  v2 
)
static

Tells if 2 nD vectors are collinear or not.

Parameters
v2equals to P2 - P1 equals to P1 - P3

Definition at line 653 of file MatrixOperations.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ are_collinear() [2/2]

template<typename GeometryTraits >
static bool FEVV::Math::Vector::are_collinear ( const typename GeometryTraits::Vector v1,
const typename GeometryTraits::Vector v2 
)
static
Parameters
v2equals to P2 - P1 equals to P1 - P3

Definition at line 679 of file MatrixOperations.hpp.

Here is the call graph for this function:

◆ cross_product() [1/3]

template<typename ElementType , int DIM>
static std::vector< ElementType > FEVV::Math::Vector::cross_product ( const ElementType  v1[DIM],
const ElementType  v2[DIM] 
)
static

Compute v1 x v2 cross product. Usually for such a function one can expect to get a return value as a "ElementType*" (dynamic allocation via new), however, with the purpose to avoid as many as possible unfreed chunk of memory, we rather use std::vector.

Definition at line 460 of file MatrixOperations.hpp.

Here is the caller graph for this function:

◆ cross_product() [2/3]

template<typename ElementType >
static std::vector< ElementType > FEVV::Math::Vector::cross_product ( const std::vector< ElementType > &  v1,
const std::vector< ElementType > &  v2 
)
static

Compute v1 x v2 cross product.

Definition at line 479 of file MatrixOperations.hpp.

◆ cross_product() [3/3]

template<typename GeometryTraits >
static GeometryTraits::Vector FEVV::Math::Vector::cross_product ( const typename GeometryTraits::Vector v1,
const typename GeometryTraits::Vector v2,
const GeometryTraits &  gt 
)
static

Definition at line 498 of file MatrixOperations.hpp.

◆ dot_product() [1/3]

template<typename ElementType , int DIM>
static ElementType FEVV::Math::Vector::dot_product ( const ElementType  v1[DIM],
const ElementType  v2[DIM] 
)
static

Compute v1 * v2 scalar product.

Definition at line 421 of file MatrixOperations.hpp.

Here is the caller graph for this function:

◆ dot_product() [2/3]

template<typename ElementType >
static ElementType FEVV::Math::Vector::dot_product ( const std::vector< ElementType > &  v1,
const std::vector< ElementType > &  v2 
)
static

Compute v1 * v2 scalar product.

Definition at line 431 of file MatrixOperations.hpp.

◆ dot_product() [3/3]

template<typename GeometryTraits >
static GeometryTraits::Scalar FEVV::Math::Vector::dot_product ( const typename GeometryTraits::Vector v1,
const typename GeometryTraits::Vector v2,
const GeometryTraits &  gt 
)
static

Definition at line 446 of file MatrixOperations.hpp.

◆ get_angle_from3positions()

template<class ElementType >
static double FEVV::Math::Vector::get_angle_from3positions ( const std::vector< ElementType > &  p1,
const std::vector< ElementType > &  p2,
const std::vector< ElementType > &  p3 
)
static

Definition at line 809 of file MatrixOperations.hpp.

Here is the call graph for this function:

◆ get_angle_from_non_unit_vectors()

template<class ElementType >
static double FEVV::Math::Vector::get_angle_from_non_unit_vectors ( const std::vector< ElementType > &  v1,
const std::vector< ElementType > &  v2 
)
static

V1 and V2 does not need to be unit vectors!

Definition at line 779 of file MatrixOperations.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_angle_from_unit_vectors() [1/2]

template<typename ElementType , int DIM>
static double FEVV::Math::Vector::get_angle_from_unit_vectors ( const ElementType  v1[DIM],
const ElementType  v2[DIM] 
)
static

V1 and V2 must be unit vectors!

Definition at line 738 of file MatrixOperations.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_angle_from_unit_vectors() [2/2]

template<typename ElementType >
static double FEVV::Math::Vector::get_angle_from_unit_vectors ( const std::vector< ElementType > &  v1,
const std::vector< ElementType > &  v2 
)
static

V1 and V2 must be unit vectors!

Definition at line 759 of file MatrixOperations.hpp.

Here is the call graph for this function:

◆ get_angle_in_degree_from3positions()

template<typename ElementType >
static double FEVV::Math::Vector::get_angle_in_degree_from3positions ( const std::vector< ElementType > &  p1,
const std::vector< ElementType > &  p2,
const std::vector< ElementType > &  p3 
)
static

Definition at line 821 of file MatrixOperations.hpp.

Here is the call graph for this function:

◆ get_angle_in_degree_from_non_unit_vectors()

template<typename ElementType >
static double FEVV::Math::Vector::get_angle_in_degree_from_non_unit_vectors ( const std::vector< ElementType > &  v1,
const std::vector< ElementType > &  v2 
)
static

Definition at line 801 of file MatrixOperations.hpp.

Here is the call graph for this function:

◆ get_angle_in_degree_from_unit_vectors() [1/2]

template<typename ElementType , int DIM>
static double FEVV::Math::Vector::get_angle_in_degree_from_unit_vectors ( const ElementType  v1[DIM],
const ElementType  v2[DIM] 
)
static

Definition at line 749 of file MatrixOperations.hpp.

Here is the call graph for this function:

◆ get_angle_in_degree_from_unit_vectors() [2/2]

template<typename ElementType >
static double FEVV::Math::Vector::get_angle_in_degree_from_unit_vectors ( const std::vector< ElementType > &  v1,
const std::vector< ElementType > &  v2 
)
static

Definition at line 770 of file MatrixOperations.hpp.

Here is the call graph for this function:

◆ l2_distance() [1/6]

template<typename ElementType , int DIM>
static double FEVV::Math::Vector::l2_distance ( const ElementType  v1[DIM],
const ElementType  v2[DIM] 
)
static

Compute ||v1 - v2||_L2 norm (distance between v1 and v2)

Definition at line 588 of file MatrixOperations.hpp.

Here is the caller graph for this function:

◆ l2_distance() [2/6]

template<typename ElementType , int DIM>
static double FEVV::Math::Vector::l2_distance ( const ElementType  v[DIM])
static

Compute ||V||_L2 norm (distance between v1 and v2)

Definition at line 599 of file MatrixOperations.hpp.

◆ l2_distance() [3/6]

template<typename ElementType >
static double FEVV::Math::Vector::l2_distance ( const std::vector< ElementType > &  v)
static

Compute ||V||_L2 norm (distance between v1 and v2)

Definition at line 635 of file MatrixOperations.hpp.

◆ l2_distance() [4/6]

template<typename ElementType >
static double FEVV::Math::Vector::l2_distance ( const std::vector< ElementType > &  v1,
const std::vector< ElementType > &  v2 
)
static

Compute ||v1 - v2||_L2 norm (distance between v1 and v2)

Definition at line 617 of file MatrixOperations.hpp.

Here is the call graph for this function:

◆ l2_distance() [5/6]

template<typename GeometryTraits >
static double FEVV::Math::Vector::l2_distance ( const typename GeometryTraits::Point p1,
const typename GeometryTraits::Point p2,
const GeometryTraits &  gt 
)
static

Compute ||p1 - p2||_L2 norm (distance between p1 and p2)

Definition at line 607 of file MatrixOperations.hpp.

◆ l2_distance() [6/6]

template<typename GeometryTraits >
static double FEVV::Math::Vector::l2_distance ( const typename GeometryTraits::Vector v,
const GeometryTraits &  gt 
)
static

Compute ||V||_L2 norm (distance between v1 and v2)

Definition at line 627 of file MatrixOperations.hpp.

◆ normalize()

template<typename GeometryTraits >
static GeometryTraits::Vector FEVV::Math::Vector::normalize ( const typename GeometryTraits::Vector v,
const GeometryTraits &  gt 
)
static

normalize a Vector: returns a pair composed of normalized input vector and of input vector length Input Vector V is not normalized

Definition at line 645 of file MatrixOperations.hpp.

Here is the caller graph for this function:

◆ proj_curv()

template<typename ElementType >
void FEVV::Math::Vector::proj_curv ( const std::vector< ElementType > &  old_u,
const std::vector< ElementType > &  old_v,
ElementType  old_ku,
ElementType  old_kuv,
ElementType  old_kv,
const std::vector< ElementType > &  new_u,
const std::vector< ElementType > &  new_v,
ElementType &  new_ku,
ElementType &  new_kuv,
ElementType &  new_kv 
)
Parameters
old_vinput
old_kuinput
old_kuvinput
old_kvinput
new_uinput
new_vinput
new_kuinput
new_kuvoutput
new_kvoutput output

Definition at line 878 of file MatrixOperations.hpp.

Here is the call graph for this function:

◆ rot_coord_sys()

template<typename ElementType >
static void FEVV::Math::Vector::rot_coord_sys ( const std::vector< ElementType > &  old_u,
const std::vector< ElementType > &  old_v,
const std::vector< ElementType > &  new_norm,
std::vector< ElementType > &  new_u,
std::vector< ElementType > &  new_v 
)
static
Parameters
old_vinput old_u which is assumed to be unit-length and perpendicular to old_v
new_norminput old_v which is assumed to be unit-length and perpendicular to old_u
new_uinput new normal
new_voutput new_u which is unit-length and perpendicular to new_v output new_v which is unit-length and perpendicular to new_u

Definition at line 833 of file MatrixOperations.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ scalar_mult() [1/2]

template<typename ElementType >
static std::vector< ElementType > FEVV::Math::Vector::scalar_mult ( const std::vector< ElementType > &  v1,
ElementType  coef 
)
static

Compute v1 * coef.

Definition at line 714 of file MatrixOperations.hpp.

Here is the caller graph for this function:

◆ scalar_mult() [2/2]

template<typename GeometryTraits >
static GeometryTraits::Vector FEVV::Math::Vector::scalar_mult ( const typename GeometryTraits::Vector v,
double  coef,
const GeometryTraits &  gt 
)
static

Definition at line 728 of file MatrixOperations.hpp.

◆ sub() [1/3]

template<typename ElementType , int DIM>
static std::vector< ElementType > FEVV::Math::Vector::sub ( const ElementType  v1[DIM],
const ElementType  v2[DIM] 
)
static

Compute v1 - v2 (subtraction)

Definition at line 508 of file MatrixOperations.hpp.

Here is the caller graph for this function:

◆ sub() [2/3]

template<typename ElementType >
static std::vector< ElementType > FEVV::Math::Vector::sub ( const std::vector< ElementType > &  v1,
const std::vector< ElementType > &  v2 
)
static

Compute v1 - v2 (subtraction)

Definition at line 521 of file MatrixOperations.hpp.

◆ sub() [3/3]

template<typename GeometryTraits >
static GeometryTraits::Vector FEVV::Math::Vector::sub ( const typename GeometryTraits::Point p1,
const typename GeometryTraits::Point p2,
const GeometryTraits &  gt 
)
static

Compute p1 - p2 (subtraction)

Definition at line 538 of file MatrixOperations.hpp.