LMCAS
Lamina Computer Algebra System
载入中...
搜索中...
未找到
matrix_quadratic_form.hpp
浏览该文件的文档.
1/**
2 * @file matrix_quadratic_form.hpp
3 * @brief Extraction of symmetric matrices from homogeneous quadratic forms.
4 */
5#pragma once
6
7#include "symbolic.hpp"
8
9#include <memory>
10#include <string>
11#include <vector>
12
13namespace LMCAS {
14
15/**
16 * @brief Extract the symmetric matrix A from the quadratic form x^T A x.
17 *
18 * Coefficients may depend on parameters outside @p vars. The expression must
19 * reconstruct exactly from the extracted matrix; nonhomogeneous expressions,
20 * higher-degree terms, unsupported derivatives, and invalid variable lists
21 * are rejected.
22 *
23 * @return The extracted matrix, or nullptr when validation fails.
24 */
25LMCAS_API std::shared_ptr<SymbolicExpr> quadratic_form_matrix(
26 const std::shared_ptr<SymbolicExpr>& expr,
27 const std::vector<std::string>& vars);
28
29}
#define LMCAS_API
__attribute__((visibility("default"))) VectorCalculusFieldResult gradient_checked(const std __attribute__((visibility("default"))) VectorCalculusFieldResult gradient_checked(const std __attribute__((visibility("default"))) VectorField gradient(const std const std::vector< std::string > & vars
std::shared_ptr< SymbolicExpr > quadratic_form_matrix(const std::shared_ptr< SymbolicExpr > &expr, const std::vector< std::string > &vars)
符号表达式主类 SymbolicExpr 及其工厂方法,运算接口.