[英]Finding index of the maximum value of cube(3d array) using Armadillo library in C++
我在 C++ 中使用 Armadillo 庫進行矩陣計算。
我有一個關於查找給定 3d arrays 最大值索引的問題。
我在他們的網站上找到了關於 index_max() 的信息。
index_max(米,暗淡)
dim=0,返回一個行向量,每列包含M對應列的極值的索引
dim=1,返回一個列向量,每行包含M對應行中極值的索引
看起來,它們返回每行和列的最大值的索引。
但我需要整個矩陣的最大值的索引。
有誰知道使用犰狳庫找到最大值索引的任何方法?
提前致謝。
代替獨立的index_max() function,使用矩陣或立方體的.index_max()成員 function。 例子:
arma::mat X(100, 200, arma::fill::randu);
arma::uword index = X.index_max();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.