30 #include <cugar/linalg/vector.h> 54 template <
typename T,
int N,
int M>
struct CUGAR_API_CS
Matrix 64 CUGAR_HOST_DEVICE
inline Matrix ();
65 CUGAR_HOST_DEVICE
inline explicit Matrix (
const T s);
66 CUGAR_HOST_DEVICE
inline explicit Matrix (
const Vector<T,M>& v);
68 CUGAR_HOST_DEVICE
inline Matrix (
const Vector<T,M> *v);
69 CUGAR_HOST_DEVICE
inline Matrix (
const T *v);
70 CUGAR_HOST_DEVICE
inline Matrix (
const T **v);
79 CUGAR_HOST_DEVICE
inline const Vector<T,M>& operator [] (
int)
const;
80 CUGAR_HOST_DEVICE
inline Vector<T,M>& operator [] (
int);
81 CUGAR_HOST_DEVICE
inline const Vector<T,M>&
get (int)
const;
82 CUGAR_HOST_DEVICE
inline void set (int,
const Vector<T,M>&);
84 CUGAR_HOST_DEVICE
inline const T& operator () (
int i,
int j)
const;
85 CUGAR_HOST_DEVICE
inline T& operator () (
int i,
int j);
87 CUGAR_HOST_DEVICE
inline T det()
const;
91 friend CUGAR_HOST_DEVICE
int operator == <T,N,M> (
const Matrix<T,N,M>&,
const Matrix<T,N,M>&);
92 friend CUGAR_HOST_DEVICE
int operator != <T,N,M> (
const Matrix<T,N,M>&,
const Matrix<T,N,M>&);
93 friend CUGAR_HOST_DEVICE Matrix<T,N,M>
operator - <T,N,M> (
const Matrix<T,N,M>&);
94 friend CUGAR_HOST_DEVICE Matrix<T,N,M>
operator + <T,N,M> (
const Matrix<T,N,M>&,
const Matrix<T,N,M>&);
95 friend CUGAR_HOST_DEVICE Matrix<T,N,M>
operator - <T,N,M> (
const Matrix<T,N,M>&,
const Matrix<T,N,M>&);
96 friend CUGAR_HOST_DEVICE Matrix<T,N,M>
operator * <T,N,M> (
const Matrix<T,N,M>&, T);
97 friend CUGAR_HOST_DEVICE Matrix<T,N,M>
operator * <T,N,M> (T,
const Matrix<T,N,M>&);
99 friend CUGAR_HOST_DEVICE Vector<T,N>
operator * <T,N> (
const Vector<T,N>&,
const Matrix<T,N,N>&);
100 friend CUGAR_HOST_DEVICE Vector<T,N>
operator * <T,N,M> (
const Matrix<T,N,M>&,
const Vector<T,M>&);
101 friend CUGAR_HOST_DEVICE Vector<T,N>
operator * <T,N> (
const Matrix<T,N,N>&,
const Vector<T,N>&);
102 friend CUGAR_HOST_DEVICE Matrix<T,N,M>
operator / <T,N,M> (
const Matrix<T,N,M>&, T);
119 template <
typename T,
int N,
int M,
int Q> CUGAR_HOST_DEVICE
Matrix<T,N,Q>& multiply (
const Matrix<T,N,M>&,
const Matrix<T,M,Q>&,
Matrix<T,N,Q>&);
120 template <
typename T,
int N,
int M,
int Q> CUGAR_HOST_DEVICE
Matrix<T,N,Q> operator * (
const Matrix<T,N,M>&,
const Matrix<T,M,Q>&);
126 template <
typename T,
int N,
int M> CUGAR_HOST_DEVICE T det (
const Matrix<T,N,M>&);
135 template <
typename T>
140 template <
typename T>
145 template <
typename T>
150 template <
typename T>
155 template <
typename T>
160 template <
typename T>
165 template <
typename T>
170 template <
typename T>
175 template <
typename T>
196 CUGAR_HOST_DEVICE
inline void svd(
208 CUGAR_HOST_DEVICE CUGAR_FORCEINLINE
209 float operator() (
const float op1,
const float op2)
const {
return op1 * op2; }
211 template <
typename T, u
int32 N, u
int32 M>
212 CUGAR_HOST_DEVICE CUGAR_FORCEINLINE
221 template <
typename T, u
int32 N, u
int32 M>
224 CUGAR_HOST_DEVICE CUGAR_FORCEINLINE
233 template <
typename T>
236 CUGAR_HOST_DEVICE CUGAR_FORCEINLINE
237 T operator() (
const T op1,
const T op2)
const {
return op1 * op2; }
259 #include <cugar/linalg/matrix_inline.h> CUGAR_HOST_DEVICE diff_var< VT, N, O > & operator+=(diff_var< VT, N, O > &a, const diff_var< VT, N, O > b)
Definition: diff.h:931
CUGAR_HOST_DEVICE Vector2f eigen_values(const Matrix2x2f &m)
Definition: matrix_inline.h:714
CUGAR_HOST_DEVICE Matrix< T, 4, 4 > rotation_around_axis(const T q, const Vector3f &axis)
Definition: matrix_inline.h:683
CUGAR_HOST_DEVICE Matrix< T, 4, 4 > translate(const Vector< T, 3 > &vec)
Definition: matrix_inline.h:524
CUGAR_HOST_DEVICE Vector2f singular_values(const Matrix2x2f &m)
Definition: matrix_inline.h:726
CUGAR_HOST_DEVICE Vector3f vtrans(const Matrix4x4f &m, const Vector3f &v)
Definition: matrix_inline.h:706
Matrix< T, 4, 4 > perspective(T fovy, T aspect, T zNear, T zFar)
Definition: matrix_inline.h:552
CUGAR_HOST_DEVICE Matrix< T, 4, 4 > rotation_around_Y(const T q)
Definition: matrix_inline.h:638
CUGAR_HOST_DEVICE Vector3f ptrans(const Matrix4x4f &m, const Vector3f &v)
Definition: matrix_inline.h:701
CUGAR_HOST_DEVICE diff_var< VT, N, O > & operator*=(diff_var< VT, N, O > &a, const diff_var< VT, N, O > b)
Definition: diff.h:949
CUGAR_HOST_DEVICE Matrix< T, 4, 4 > rotation_around_Z(const T q)
Definition: matrix_inline.h:660
CUGAR_HOST_DEVICE void svd(const Matrix2x2f &m, Matrix2x2f &u, Vector2f &s, Matrix2x2f &v)
Definition: matrix_inline.h:752
Matrix< T, 4, 4 > look_at(const Vector< T, 3 > &eye, const Vector< T, 3 > ¢er, const Vector< T, 3 > &up, bool flip_sign=false)
Definition: matrix_inline.h:568
Define a vector_view POD type and plain_view() for std::vector.
Definition: diff.h:38
CUGAR_HOST_DEVICE diff_var< VT, N, O > & operator/=(diff_var< VT, N, O > &a, const diff_var< VT, N, O > b)
Definition: diff.h:958
CUGAR_API_CS CUGAR_HOST_DEVICE Matrix< T, N, M > outer_product(const Vector< T, N > op1, const Vector< T, M > op2)
Definition: matrix_inline.h:503
CUGAR_HOST_DEVICE Matrix< T, 4, 4 > rotation_around_X(const T q)
Definition: matrix_inline.h:616
Matrix< T, 4, 4 > inverse_look_at(const Vector< T, 3 > &eye, const Vector< T, 3 > ¢er, const Vector< T, 3 > &up, bool flip_sign=false)
Definition: matrix_inline.h:592
CUGAR_HOST_DEVICE Matrix< T, 4, 4 > scale(const Vector< T, 3 > &vec)
build a 3d scaling matrix
Definition: matrix_inline.h:539
CUGAR_HOST_DEVICE diff_var< VT, N, O > & operator-=(diff_var< VT, N, O > &a, const diff_var< VT, N, O > b)
Definition: diff.h:940