10 template<sdt Dim,
class Real,
int Options>
class VecSwizCon;
12 template<sdt Dim,
class Real,
int Options>
16 class VecSwizConBase :
public Vec< matrix::priv::Traits<SwizT>::dim, typename matrix::priv::Traits<SwizT>::Real,
17 matrix::priv::Traits<SwizT>::options>
21 SwizT& fromScalar(
Real f);
27 SwizT& operator*=(
Real rhs);
28 SwizT& operator/=(
Real rhs);
29 SwizT& elemAddEq(
Real rhs);
30 SwizT& elemSubEq(
Real rhs);
38 template<
class T_, sdt D,
class R,
int Opt>
41 template<
class T,
class O,
class Func>
42 static O&& func(T&&, O&&, Func&&) { static_assert(!
mt::True<T>::value,
"Can't map with const swizzle output"); }
45 template<
class T_, sdt D,
class R,
int Opt,
class T2_>
46 struct priv::map_impl<T_, VecSwizCon<D,R,Opt>, T2_>
48 template<
class T,
class T2,
class O,
class Func>
49 static O&& func(T&&, T2&&, O&&, Func&&) { static_assert(!mt::True<T>::value,
"Can't map with const swizzle output"); }
53 template<sdt Dim,
class Real,
int Options>
class VecSwizRef;
56 template<sdt Dim,
class Real,
int Options>
60 class VecSwizRefBase :
public Vec< matrix::priv::Traits<SwizT>::dim, typename matrix::priv::Traits<SwizT>::Real,
61 matrix::priv::Traits<SwizT>::options>
92 const SwizT&
swiz()
const {
return static_cast<const SwizT&
>(*this); }
93 SwizT&
swiz() {
return static_cast<SwizT&
>(*this); }
97 template<
class T_, sdt D,
class R,
int Opt>
98 struct priv::map_impl<T_, VecSwizRef<D,R,Opt>>
100 template<
class T,
class O,
class Func>
101 static O&& func(T&& v, O&& o, Func&& f) {
map(forward<T>(v), forward<typename O::Super>(o), forward<Func>(f)); o.swiz().commit();
return forward<O>(o); }
104 template<
class T_, sdt D,
class R,
int Opt,
class T2_>
105 struct priv::map_impl<T_, VecSwizRef<D,R,Opt>, T2_>
107 template<
class T,
class T2,
class O,
class Func>
108 static O&& func(T&& v, T2&& v2, O&& o, Func&& f) {
map(forward<T>(v), forward<T2>(v2), forward<typename O::Super>(o), forward<Func>(f)); o.swiz().commit();
return forward<O>(o); }
MatrixS & fromScalar(Real f)
Initialize with scalar in every element.
Definition: Base.h:72
SwizT & operator=(const VecSwizRefBase &rhs)
Definition: Swiz.h:75
MatrixS & operator+=(const MatrixBase< T > &rhs)
Definition: Base.h:147
Vector for const swizzle operators.
Definition: Swiz.h:10
SwizT & swiz()
Definition: Swiz.h:93
SwizT & operator-=(const MatrixBase< T > &rhs)
Definition: Swiz.h:81
SwizT & operator=(const MatrixBase< T > &rhs)
Definition: Swiz.h:77
SwizT & operator*=(Real rhs)
Definition: Swiz.h:82
SwizT & operator+=(Real rhs)
Definition: Swiz.h:69
SwizT & operator/=(Real rhs)
Definition: Swiz.h:83
MatrixS & elemDivEq(const MatrixBase< T > &rhs)
Divide each element by its corresponding element in rhs.
Definition: Base.h:208
SwizT & fromZero()
Wrapper ops.
Definition: Swiz.h:73
SwizT & operator=(Real rhs)
Allow scalar ops.
Definition: Swiz.h:68
const SwizT & swiz() const
Get subclass.
Definition: Swiz.h:92
N-dimensional vector.
Definition: Traits.h:12
Always returns true. Can be used to force a clause to be type dependent.
Definition: Meta.h:31
SwizT & elemAddEq(Real rhs)
Definition: Swiz.h:84
SwizT & operator-=(Real rhs)
Definition: Swiz.h:70
float Real
Real number type. See Real_ for real number operations and constants.
Definition: Real.h:21
MatrixS & fromZero()
Zero all elements.
Definition: Base.h:70
Vec & operator=(const MatrixBase< T > &rhs)
Assign to row or column vector of any dimension. Asserts that if this vector has a fixed dimension th...
Definition: Vec.h:56
MatrixS & operator*=(const MatrixBase< T > &rhs)
Definition: Base.h:181
MatrixS & elemAddEq(Real rhs)
Add rhs to each element.
Definition: Base.h:192
SwizT & elemDivEq(const MatrixBase< T > &rhs)
Definition: Swiz.h:89
MatrixS & elemMulEq(const MatrixBase< T > &rhs)
Multiply each element with its corresponding element in rhs.
Definition: Base.h:202
MatrixS & operator/=(Real rhs)
Definition: Base.h:185
MatrixS & elemSubEq(Real rhs)
Subtract rhs from each element.
Definition: Base.h:196
SwizT & elemMulEq(const MatrixBase< T > &rhs)
Definition: Swiz.h:87
Matrix base class.
Definition: Base.h:17
SwizT & elemSubEq(Real rhs)
Definition: Swiz.h:85
MatrixS & operator-=(const MatrixBase< T > &rhs)
Definition: Base.h:157
Vector reference holder for mutable swizzle operators.
Definition: Swiz.h:54
Global Honeycomb namespace.
Vec< matrix::priv::Traits< SwizT >::dim, typename matrix::priv::Traits< SwizT >::Real, matrix::priv::Traits< SwizT >::options > Super
Definition: Swiz.h:65
SwizT & operator+=(const MatrixBase< T > &rhs)
Definition: Swiz.h:79
SwizT & fromScalar(Real f)
Definition: Swiz.h:74
OutSeq && map(Range &&, Seqs &&..., OutSeq &&, Func &&)
Transform a series of sequences into an output.