NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
nc::Shape Class Reference

A Shape Class for NdArrays. More...

#include <Shape.hpp>

Public Member Functions

constexpr Shape ()=default
 
constexpr Shape (uint32 inRows, uint32 inCols) noexcept
 
constexpr Shape (uint32 inSquareSize) noexcept
 
bool isnull () const noexcept
 
bool issquare () const noexcept
 
bool operator!= (const Shape &inOtherShape) const noexcept
 
bool operator== (const Shape &inOtherShape) const noexcept
 
void print () const
 
uint32 size () const noexcept
 
std::string str () const
 

Data Fields

uint32 cols { 0 }
 
uint32 rows { 0 }
 

Friends

std::ostream & operator<< (std::ostream &inOStream, const Shape &inShape)
 

Detailed Description

A Shape Class for NdArrays.

Constructor & Destructor Documentation

◆ Shape() [1/3]

constexpr nc::Shape::Shape ( )
constexprdefault

Constructor

◆ Shape() [2/3]

constexpr nc::Shape::Shape ( uint32  inSquareSize)
inlineexplicitconstexprnoexcept

Constructor

Parameters
inSquareSize

◆ Shape() [3/3]

constexpr nc::Shape::Shape ( uint32  inRows,
uint32  inCols 
)
inlineconstexprnoexcept

Constructor

Parameters
inRows
inCols

Member Function Documentation

◆ isnull()

bool nc::Shape::isnull ( ) const
inlinenoexcept

Returns whether the shape is null (constructed with the default constructor).

Returns
bool

◆ issquare()

bool nc::Shape::issquare ( ) const
inlinenoexcept

Returns whether the shape is square or not.

Returns
bool

◆ operator!=()

bool nc::Shape::operator!= ( const Shape inOtherShape) const
inlinenoexcept

Not equality operator

Parameters
inOtherShape
Returns
bool

◆ operator==()

bool nc::Shape::operator== ( const Shape inOtherShape) const
inlinenoexcept

Equality operator

Parameters
inOtherShape
Returns
bool

◆ print()

void nc::Shape::print ( ) const
inline

Prints the shape to the console

◆ size()

uint32 nc::Shape::size ( ) const
inlinenoexcept

Returns the size of the shape

Returns
size

◆ str()

std::string nc::Shape::str ( ) const
inline

Returns the shape as a string representation

Returns
std::string

Friends And Related Function Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream &  inOStream,
const Shape inShape 
)
friend

IO operator for the Shape class

Parameters
inOStream
inShape
Returns
std::ostream

Field Documentation

◆ cols

uint32 nc::Shape::cols { 0 }

◆ rows

uint32 nc::Shape::rows { 0 }

The documentation for this class was generated from the following file: