Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Sofa/framework/Type/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ set(SOURCE_FILES
${SOFATYPESRC_ROOT}/Frame.cpp
${SOFATYPESRC_ROOT}/Mat.cpp
${SOFATYPESRC_ROOT}/Material.cpp
${SOFATYPESRC_ROOT}/MatSym.cpp
${SOFATYPESRC_ROOT}/PrimitiveGroup.cpp
${SOFATYPESRC_ROOT}/Quat.cpp
${SOFATYPESRC_ROOT}/RGBAColor.cpp
Expand Down
47 changes: 47 additions & 0 deletions Sofa/framework/Type/src/sofa/type/MatSym.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
/******************************************************************************
* SOFA, Simulation Open-Framework Architecture *
* (c) 2006 INRIA, USTL, UJF, CNRS, MGH *
* *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*******************************************************************************
* Authors: The SOFA Team and external contributors (see Authors.txt) *
* *
* Contact information: [email protected] *
******************************************************************************/
#define SOFA_TYPE_MATSYM_CPP

#include <sofa/type/MatSym.h>

namespace sofa::type
{

template class SOFA_TYPE_API MatSym< 1, float>;
template class SOFA_TYPE_API MatSym< 2, float>;
template class SOFA_TYPE_API MatSym< 3, float>;
template class SOFA_TYPE_API MatSym< 4, float>;
template class SOFA_TYPE_API MatSym< 6, float>;
template class SOFA_TYPE_API MatSym< 9, float>;
template class SOFA_TYPE_API MatSym<12, float>;
template class SOFA_TYPE_API MatSym<24, float>;

template class SOFA_TYPE_API MatSym< 1, double>;
template class SOFA_TYPE_API MatSym< 2, double>;
template class SOFA_TYPE_API MatSym< 3, double>;
template class SOFA_TYPE_API MatSym< 4, double>;
template class SOFA_TYPE_API MatSym< 6, double>;
template class SOFA_TYPE_API MatSym< 9, double>;
template class SOFA_TYPE_API MatSym<12, double>;
template class SOFA_TYPE_API MatSym<24, double>;

} // namespace sofa::type
27 changes: 23 additions & 4 deletions Sofa/framework/Type/src/sofa/type/MatSym.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,7 @@ class MatSym : public VecNoInit<D * (D + 1) / 2, real>
/// Sets each element to r.
void fill(real r)
{
for (sofa::Size i = 0; i < NumberStoredValues; i++)
{
this->elems[i].fill(r);
}
std::fill(this->elems.begin(), this->elems.end(), r);
}

/// Write access to element (i,j).
Expand Down Expand Up @@ -708,4 +705,26 @@ inline real scalarProduct(const Mat<D,D,real>& left, const MatSym<D,real>& right
return scalarProduct(right, left);
}

#if !defined(SOFA_TYPE_MATSYM_CPP)

extern template class SOFA_TYPE_API MatSym< 1, float>;
extern template class SOFA_TYPE_API MatSym< 2, float>;
extern template class SOFA_TYPE_API MatSym< 3, float>;
extern template class SOFA_TYPE_API MatSym< 4, float>;
extern template class SOFA_TYPE_API MatSym< 6, float>;
extern template class SOFA_TYPE_API MatSym< 9, float>;
extern template class SOFA_TYPE_API MatSym<12, float>;
extern template class SOFA_TYPE_API MatSym<24, float>;

extern template class SOFA_TYPE_API MatSym< 1, double>;
extern template class SOFA_TYPE_API MatSym< 2, double>;
extern template class SOFA_TYPE_API MatSym< 3, double>;
extern template class SOFA_TYPE_API MatSym< 4, double>;
extern template class SOFA_TYPE_API MatSym< 6, double>;
extern template class SOFA_TYPE_API MatSym< 9, double>;
extern template class SOFA_TYPE_API MatSym<12, double>;
extern template class SOFA_TYPE_API MatSym<24, double>;

#endif

} // namespace sofa::type
Loading