16 .description(
"Matrix to decompose, only the 3x3 part is used");
17 b.add_output<
decl::Matrix>(
"U"_ustr).description(
"Left singular vectors");
18 b.add_output<
decl::Vector>(
"S"_ustr).description(
"Singular values");
19 b.add_output<
decl::Matrix>(
"V"_ustr).description(
"Right singular vectors");
26 static mf::Signature signature_;
27 mf::SignatureBuilder builder{
"Matrix SVD", signature_};
28 builder.single_input<
float4x4>(
"Matrix");
29 builder.single_output<
float4x4>(
"U");
30 builder.single_output<
float3>(
"S");
31 builder.single_output<
float4x4>(
"V");
42 const float3x3 matrix = matrices[i].view<3, 3>();
71 ntype.
ui_description =
"Compute the singular value decomposition of the 3x3 part of a matrix";
#define NODE_CLASS_CONVERTER
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void set_signature(const Signature *signature)
void set_matching_fn(const mf::MultiFunction *fn)
void call(const IndexMask &mask, mf::Params params, mf::Context) const override
void node_register_type(bNodeType &ntype)
static void node_build_multi_function(NodeMultiFunctionBuilder &builder)
static int node_gpu_material(GPUMaterial *mat, bNode *node, bNodeExecData *, GPUNodeStack *in, GPUNodeStack *out)
static void node_declare(NodeDeclarationBuilder &b)
static void node_register()
bool GPU_stack_link(GPUMaterial *mat, const bNode *node, const char *name, GPUNodeStack *in, GPUNodeStack *out,...)
void BLI_svd_m3(const float m3[3][3], float r_U[3][3], float r_S[3], float r_V[3][3])
Compute the SVD (Singular Values Decomposition) of given 3D matrix (m3 = USV*).
void fn_cmp_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
MatBase< float, 4, 4 > float4x4
MatBase< float, 3, 3 > float3x3
VecBase< float, 3 > float3
const c_style_mat & ptr() const
std::string ui_description
NodeGPUExecFunction gpu_fn
NodeMultiFunctionBuildFunction build_multi_function
NodeDeclareFunction declare