mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-02-16 17:45:52 +00:00
tbsp: bugfix when outputStride > 1
This commit is contained in:
parent
36aaa77436
commit
e34b854338
1 changed files with 16 additions and 5 deletions
|
@ -281,10 +281,16 @@ static void evalRange(P * TBSP_RESTRICT dst, size_t numdst, P * TBSP_RESTRICT wo
|
||||||
}
|
}
|
||||||
|
|
||||||
// right out-of-bounds
|
// right out-of-bounds
|
||||||
for( ; i < numdst; ++i)
|
if(i < numdst)
|
||||||
{
|
{
|
||||||
*dst = controlpoints[numcp - 1];
|
const P p = controlpoints[(numcp - 1) * inputStride];
|
||||||
dst += outputStride;
|
do
|
||||||
|
{
|
||||||
|
*dst = p;
|
||||||
|
dst += outputStride;
|
||||||
|
++i;
|
||||||
|
}
|
||||||
|
while(i < numdst);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -520,8 +526,9 @@ struct Cholesky
|
||||||
}
|
}
|
||||||
|
|
||||||
// Solves x for A * x + b. Both b and x must have length n.
|
// Solves x for A * x + b. Both b and x must have length n.
|
||||||
|
// Can solve in-place, ie. you may pass xv == bv.
|
||||||
template<typename P>
|
template<typename P>
|
||||||
void solve(P * TBSP_RESTRICT const xv, const P * TBSP_RESTRICT const bv) const
|
void solve(P * const xv, const P * const bv) const
|
||||||
{
|
{
|
||||||
const size_t n = L.size.w;
|
const size_t n = L.size.w;
|
||||||
|
|
||||||
|
@ -602,8 +609,9 @@ struct LUDecomp
|
||||||
}
|
}
|
||||||
|
|
||||||
// Solves x for A * x + b. Both b and x must have length n.
|
// Solves x for A * x + b. Both b and x must have length n.
|
||||||
|
// Can solve in-place, ie. you may pass xv == bv.
|
||||||
template<typename P>
|
template<typename P>
|
||||||
void solve(P * TBSP_RESTRICT const xv, const P * TBSP_RESTRICT const bv) const
|
void solve(P * const xv, const P * const bv) const
|
||||||
{
|
{
|
||||||
const size_t n = LU.size.w;
|
const size_t n = LU.size.w;
|
||||||
|
|
||||||
|
@ -797,6 +805,9 @@ struct Interpolator
|
||||||
template<typename P>
|
template<typename P>
|
||||||
size_t generateControlPoints(P * cp, P * TBSP_RESTRICT workmem, const P *points) const;
|
size_t generateControlPoints(P * cp, P * TBSP_RESTRICT workmem, const P *points) const;
|
||||||
|
|
||||||
|
inline size_t getNumGeneratedControlPoints() { return numcp; }
|
||||||
|
inline size_t getNumInputPoints() { return nump; }
|
||||||
|
|
||||||
// ------------------------
|
// ------------------------
|
||||||
protected:
|
protected:
|
||||||
size_t numcp, nump;
|
size_t numcp, nump;
|
||||||
|
|
Loading…
Add table
Reference in a new issue