7#ifndef btReducedVectors_h
8#define btReducedVectors_h
61 for (
int i = 0; i < old_indices.
size(); ++i)
83 else if (
m_indices[i] > other.m_indices[j])
85 ret.m_indices.push_back(other.m_indices[j]);
86 ret.m_vecs.push_back(other.m_vecs[j]);
91 ret.m_indices.push_back(other.m_indices[j]);
92 ret.m_vecs.push_back(
m_vecs[i] + other.m_vecs[j]);
102 while (j < other.m_indices.size())
104 ret.m_indices.push_back(other.m_indices[j]);
105 ret.m_vecs.push_back(other.m_vecs[j]);
136 else if (
m_indices[i] > other.m_indices[j])
138 ret.m_indices.push_back(other.m_indices[j]);
139 ret.m_vecs.push_back(-other.m_vecs[j]);
144 ret.m_indices.push_back(other.m_indices[j]);
145 ret.m_vecs.push_back(
m_vecs[i] - other.m_vecs[j]);
155 while (j < other.m_indices.size())
157 ret.m_indices.push_back(other.m_indices[j]);
158 ret.m_vecs.push_back(-other.m_vecs[j]);
167 if (
m_sz != other.m_sz)
173 if (
m_indices[i] != other.m_indices[i] ||
m_vecs[i] != other.m_vecs[i])
183 return !(*
this == other);
204 while (j < other.m_indices.size() && other.m_indices[j] <
m_indices[i])
208 if (j < other.m_indices.size() && other.m_indices[j] ==
m_indices[i])
229 return this->
dot(*
this);
259 std::vector<TwoInts> tuples;
265 tuples.push_back(ti);
267 std::sort(tuples.begin(), tuples.end());
270 for (
int i = 0; i < tuples.size(); ++i)
283 for (
int i = 0; i <
v.m_indices.size(); ++i)
285 ret.m_indices.push_back(
v.m_indices[i]);
286 ret.m_vecs.push_back(s*
v.m_vecs[i]);
ATTR_WARN_UNUSED_RESULT const BMVert * v2
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE btReducedVector & operator/=(btReducedVector &v, btScalar s)
SIMD_FORCE_INLINE btReducedVector & operator+=(btReducedVector &v1, const btReducedVector &v2)
SIMD_FORCE_INLINE btReducedVector operator*(const btReducedVector &v, btScalar s)
bool operator<(const TwoInts &A, const TwoInts &B)
SIMD_FORCE_INLINE btReducedVector & operator-=(btReducedVector &v1, const btReducedVector &v2)
SIMD_FORCE_INLINE btReducedVector operator/(const btReducedVector &v, btScalar s)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define SIMD_FORCE_INLINE
SIMD_FORCE_INLINE void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0),...
void copyFromArray(const btAlignedObjectArray &otherArray)
SIMD_FORCE_INLINE int size() const
return the number of elements in the array
SIMD_FORCE_INLINE void resize(int newsize, const T &fillData=T())
SIMD_FORCE_INLINE void push_back(const T &_Val)
btAlignedObjectArray< int > m_indices
btReducedVector operator-(const btReducedVector &other)
btReducedVector proj(const btReducedVector &other) const
btReducedVector operator+(const btReducedVector &other)
bool operator==(const btReducedVector &other) const
btReducedVector(int sz, const btAlignedObjectArray< int > &indices, const btAlignedObjectArray< btVector3 > &vecs)
btScalar dot(const btAlignedObjectArray< btVector3 > &other) const
btAlignedObjectArray< btVector3 > m_vecs
btReducedVector operator-()
bool operator!=(const btReducedVector &other) const
btScalar dot(const btReducedVector &other) const
bool testMultiply() const
btReducedVector & operator=(const btReducedVector &other)
local_group_size(16, 16) .push_constant(Type b