【お知らせ】この部分は英語原文のみでの提供となります。何卒ご了承ください。

2.2.3.9.36 matrixbase::GetNumCols

Contents

Description

Get the number of columns in any matrixbase derived object (e.g. matrix, Matrix).

Syntax

int GetNumCols( )const

Parameters

Return

Returns the number of columns in this matrixbase object.

Examples

EX1

void matrixbase_GetNumCols_ex1()
{
    matrix mat(2,3) ={ 
        {11, 12, 13}, 
        {21, 22, 23}
    };
    int iNumCols;
    iNumCols = mat.GetNumCols(); // Demonstration of GetNumCols
    printf("  Given matrix:\n"              "    11 12 13\n"              "    21 22 23\n");
    printf("  The number of Columns = %d\n",iNumCols);
}

Remark

See Also

matrixbase::GetNumRows, matrixbase::GetNumRows, matrixbase::SetSize

Header to Include

origin.h