Loading...
Searching...
No Matches
BLAS-Impl.hpp
Go to the documentation of this file.
1// This code is based on Jet framework.
2// Copyright (c) 2018 Doyub Kim
3// CubbyFlow is voxel-based fluid simulation engine for computer games.
4// Copyright (c) 2020 CubbyFlow Team
5// Core Part: Chris Ohk, Junwoo Hwang, Jihong Sin, Seungwoo Yoo
6// AI Part: Dongheon Cho, Minseo Kim
7// We are making my contributions/submissions to this project solely in our
8// personal capacity and are not conveying any rights to any intellectual
9// property of any third parties.
10
11#ifndef CUBBYFLOW_BLAS_IMPL_HPP
12#define CUBBYFLOW_BLAS_IMPL_HPP
13
14#include <cmath>
15
16namespace CubbyFlow
17{
18template <typename ScalarType, typename VectorType, typename MatrixType>
24
25template <typename ScalarType, typename VectorType, typename MatrixType>
31
32template <typename ScalarType, typename VectorType, typename MatrixType>
38
39template <typename ScalarType, typename VectorType, typename MatrixType>
45
46template <typename ScalarType, typename VectorType, typename MatrixType>
52
53template <typename ScalarType, typename VectorType, typename MatrixType>
61
62template <typename ScalarType, typename VectorType, typename MatrixType>
69
70template <typename ScalarType, typename VectorType, typename MatrixType>
72 const VectorType& x,
73 const VectorType& b,
75{
76 *result = b - a * x;
77}
78
79template <typename ScalarType, typename VectorType, typename MatrixType>
84
85template <typename ScalarType, typename VectorType, typename MatrixType>
91} // namespace CubbyFlow
92
93#endif
void CopyFrom(const MatrixExpression< T, R, C, E > &expression)
Copies from generic expression.
Definition MatrixDenseBase-Impl.hpp:21
std::enable_if_t<(IsMatrixSizeDynamic< Rows, Cols >()||Cols==1) &&(IsMatrixSizeDynamic< R, C >()||C==1), U > Dot(const MatrixExpression< T, R, C, E > &expression) const
Definition MatrixExpression-Impl.hpp:391
ValueType AbsMax() const
Definition MatrixExpression-Impl.hpp:162
Definition Matrix.hpp:30
void Fill(const T &val)
Definition Matrix-Impl.hpp:226
Definition pybind11Utils.hpp:21
Matrix< T, Rows, 1 > Vector
Definition Matrix.hpp:738
static ScalarType L2Norm(const VectorType &v)
Returns L2-norm of the given vector v.
Definition BLAS-Impl.hpp:80
static void Set(ScalarType s, VectorType *result)
Sets entire element of given vector result with scalar s.
Definition BLAS-Impl.hpp:19
M MatrixType
Definition BLAS.hpp:32
static void Residual(const MatrixType &a, const VectorType &x, const VectorType &b, VectorType *result)
Computes residual vector (b - ax).
Definition BLAS-Impl.hpp:71
V VectorType
Definition BLAS.hpp:31
static void MVM(const MatrixType &m, const VectorType &v, VectorType *result)
Performs matrix-vector multiplication.
Definition BLAS-Impl.hpp:63
static void AXPlusY(ScalarType a, const VectorType &x, const VectorType &y, VectorType *result)
Definition BLAS-Impl.hpp:54
static ScalarType LInfNorm(const VectorType &v)
Returns L-inf-norm of the given vector v.
Definition BLAS-Impl.hpp:86
S ScalarType
Definition BLAS.hpp:30
static ScalarType Dot(const VectorType &a, const VectorType &b)
Performs dot product with vector a and b.
Definition BLAS-Impl.hpp:47