![](https://img-blog.csdnimg.cn/20200726173828989.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
Armadillo
文章平均质量分 81
Armadillo及相关线性代数库的说明,主要介绍了Armadillo,次要介绍矩阵运算在部分软件中的应用。
UPUPUPEveryday
关注嵌入式/Arm/DSP/STM32/数据/图像处理与分析
展开
-
Armadillo:成员函数和变量(一)
要更改大小,请使用 .set_size()、.copy_size()、.zeros()、.ones()、 或者 .reset()old_value和new_value的类型必须与容器对象使用的元素类型匹配(例如,对于 mat,类型为 double)将沿主对角线的元素设置为 1,将非对角线元素设置为零, (可选)首先将大小更改为指定尺寸。更改对象的大小,而不显式保留数据,也不初始化元素(即元素可能包含垃圾值,包括 NaN)值的类型必须与容器对象使用的元素类型匹配(例如,对于 mat,类型为 double)原创 2024-03-06 19:40:31 · 70 阅读 · 0 评论 -
Halcon矩阵(Matrix)算子详解
Halcon矩阵(Matrix)详细说明创建(Creation)create_matrixcopy_matrixrepeat_matrix访问(Access)算法(Arithmetic)分解(Decomposition)特征值(Eigenvalues)特性(Features)文件操作(File)新的改变功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注原创 2021-01-27 17:21:39 · 7126 阅读 · 2 评论 -
Armadillo:矩阵类、向量类、Cube类和泛型类
为方便起见,每个向量类型都有几个预定义的 typedef (其中类型为:urowvec、irowvec、frowvec、rowvec、cx_frowvec、cx_rowvec)。为方便起见,每个向量类型都有几个预定义的 typedef (其中类型为:UVEC、IVEC、FVEC、VEC、cx_fvec、cx_vec以及相应的 COLVEC 版本)。注意:涉及相等比较的运算符(比如 , , ,) 不建议用于 mat 或 fmat 类型的矩阵, 由于浮点元素类型的精度必然有限;向量的内存在编译时保留。原创 2024-03-05 22:38:16 · 1332 阅读 · 0 评论 -
Armadillo:C++线性代数运行库的版本更迭史
API 添加和更改的历史记录。原创 2024-03-05 10:12:49 · 946 阅读 · 0 评论 -
Armadillo API的详细清单及功能介绍
概述矩阵类、向量类、立方体类和字段类成员函数和变量生成的向量/矩阵/立方体向量/矩阵/立方体的函数分解、因式分解、逆和方程求解器(密集矩阵)分解、因式分解和方程求解器(稀疏矩阵)统计与聚类杂项矩阵类、向量类、立方体类和字段类函数名功能介绍Mat, mat, cx_mat密集矩阵类Col, colvec, vec密集列向量类Row, rowvec密集行向量类Cube, cube, cx_cube密集立方体类(“3D 矩阵”)field类,用于在原创 2024-03-05 11:14:23 · 1142 阅读 · 0 评论 -
Armadillo使用介绍(十三):常量
常量 (pi, inf, 光速, …)datum::pi π, the ratio of any circle’s circumference to its diameter 圆周率datum::inf ∞, infinity 无穷大datum::nan “not a number” (NaN); 注意: NaN is not equal to anything, even itself 非数字datum::e base of the natural logarithm 自然常数d原创 2020-07-17 21:39:09 · 575 阅读 · 2 评论 -
Armadillo使用介绍(十二):fft / ifft
fft / ifft用途:fft / ifft函数用于一维快速傅里叶变换/快速傅里叶逆变换。该函数重载有cx_mat Y = fft( X )、cx_mat Y = fft( X, n )、cx_mat Z = ifft( cx_mat Y )、cx_mat Z = ifft( cx_mat Y, n )类型:普通函数隶属:Signal & Image Processing1、fft(): fast Fourier transform of a vector or matrix (re原创 2020-07-13 20:54:26 · 1424 阅读 · 6 评论 -
Armadillo使用介绍(十一):conv
conv用途:conv函数用于一维卷积。类型:普通函数隶属:Signal & Image Processing1D convolution of vectors A and BThe orientation of the result vector is the same as the orientation of A (ie. either column or row vector)The shape argument is optional; it is one of:原创 2020-07-12 18:35:41 · 701 阅读 · 0 评论 -
Armadillo使用介绍(十):运算符
+ − * / % == != <= >= < >类型:运算符示例代码如下:mat A = randu<mat>(5,10);mat B = randu<mat>(5,10);mat C = randu<mat>(10,5);mat P = A + B;mat Q = A - B;mat R = -B;mat S = A / 123.0;mat T = A % B;mat U = A * C;// V原创 2020-07-12 13:50:27 · 1071 阅读 · 0 评论 -
Armadillo使用介绍(九):下载Armadillo、配置工程、运行第一个程序
一、下载Armadillo通过以下两种途径下载Armadillo C++库源码:Armadillo Download page如下图所示,可以下载到最新版本的armadillo库(随着时间变化,armadillo版本可能会比图示的版本更高)。点击上图红框中的链接后,会进入下图所示页面,自动下载源码。Armadillo Gitlab page可以从Armadillo在Gitlab的仓库下载到最新的源码(Armadillo的仓库在Gitlab而非Github的原因,参见“What happen原创 2020-07-12 08:05:32 · 2509 阅读 · 1 评论 -
Armadillo使用介绍(八):第二个Armadillo程序
源码#include <iostream>#include <armadillo>using namespace std;using namespace arma;// Armadillo documentation is available at:// http://arma.sourceforge.net/docs.html// NOTE: the C++11 "auto" keyword is not recommended for use with Arm原创 2020-07-11 22:51:40 · 888 阅读 · 1 评论 -
Armadillo使用介绍(七):wall_clock
wall_clock用途:wall_clock函数用于计时类型:普通函数示例代码如下:wall_clock timer;mat A = randu<mat>(100,100);mat B = randu<mat>(100,100);mat C;timer.tic();for(uword i=0; i<100000; ++i) { C = A + B + A + B; }double n = timer.toc();cout <&原创 2020-07-11 21:36:52 · 322 阅读 · 0 评论 -
Armadillo使用介绍(六):find、clamp、.replace
find用途:find函数用于寻找非零元素或者满足条件的元素的索引。该函数重载有find( X )、find( X, k )、find( X, k, s )。类型:普通函数1、返回包含非零或满足关系条件的X元素的索引的列向量2、输出向量必须具有uvec 类型(即索引存储类型为无符号整数uword)3、X可理解为向量,按列对 X 元素进行排序4、可以用关系运算符代替X,例如。A > 0.55、如果k=0(默认值),返回所有非零元素的索引,否则最多返回k个索引6、如果s=“first”(原创 2020-07-11 21:20:00 · 1257 阅读 · 0 评论 -
Armadillo使用介绍(一):Armadillo介绍
Armadillo采用的许可是 Apache License 2.0,不具有GPL许可的感染性。对于Apache License 与GPL之间的关系,官方文档中解释“The Apache license and the GPL are completely separate and distinct licenses. Unlike the GPL, the Apache license does not "infect" your source code. See also the comparison原创 2020-07-10 23:29:55 · 6147 阅读 · 2 评论 -
Armadillo使用介绍(二):Armadillo语法与Matlab/Octave语法的联系
Matlab/OctaveArmadillo备注A(1, 1)A(0, 0)indexing in Armadillo starts at 0A(k, k)A(k-1, k-1)size(A,1)A.n_rowsread onlysize(A,2)A.n_colssize(Q,3)Q.n_slicesQ is a cube (3D array)numel(A)A.n_elemA(:, k)A.col(k)...原创 2020-07-10 22:45:57 · 1308 阅读 · 0 评论 -
Armadillo使用介绍(三):第一个Armadillo程序
#include <iostream>#include <armadillo>//包含armadillo头文件using namespace std;using namespace arma;//armadillo命名空间int main() { mat A = randu<mat>(4,5);//4行5列矩阵 mat B = randu<mat>(4,5); cout << A*B.t() << en原创 2020-07-10 22:21:00 · 1089 阅读 · 0 评论 -
Armadillo使用介绍(五):any,all,.is_zero
any函数用于判断数据向量或者矩阵中是否有任一元素满足条件,满足则返回1,不满足则返回0。三种any( V )、any( X )、any( X, dim )vec V = randu<vec>(10);mat X = randu<mat>(5,5);// status1 will be set to true if vector V has any non-zero elementsbool status1 = any(V);// status2 will be s原创 2020-07-10 20:06:32 · 830 阅读 · 0 评论 -
Armadillo使用介绍(四):向量创建
创建vec v1 = "1,2,3,4";vec v2 = initializer_list < double > {1, 2, 3, 4};vec v3; //向量未初始化v3 << 1 << 2 << 3 << 4;vec v4(v1);double *elem = new double[4]{1, 2, 3, 4};vec v5(elem, 4); //这个是从elem指针指向的内存中复制元素,所以是安全的vec v6(e原创 2020-07-10 13:42:56 · 1950 阅读 · 2 评论