AuxPort 0.2
Modules for Audio Software Development
Loading...
Searching...
No Matches
AuxPort::AuxPascal Class Reference

This class provide an interface to compute and manage a Pascal Triangle. More...

#include <AuxPascal.h>

Inheritance diagram for AuxPort::AuxPascal:
AuxPort::TextFile AuxPort::TextFormat

Public Types

enum  Type { Positive , Negative }
 Type is an enumerator that specifies the type of Pascal Triangle: Positive or Negative. More...
 

Public Member Functions

 AuxPascal (const AuxPascal &obj)=default
 
std::vector< std::vector< float > > computePascalTriangle (uint32 N, const Type &type=Type::Positive)
 Computes N'th rows of the pascal triangle and returns a 2-D vector of floats.
 
void Log () override
 Logs the computed Pascal Triangle.
 
void writeToFile (const std::string &fileName)
 Writes the computed Pascal Triangle into a textfile.
 
void readFromFile (const std::string &fileName)
 Reads and loads coefficients of pascal triangle from a textfile.
 
void logFileInfo ()
 Logs the info of last file that was read/written.
 

Detailed Description

This class provide an interface to compute and manage a Pascal Triangle.

Definition at line 50 of file AuxPascal.h.

Member Enumeration Documentation

◆ Type

Type is an enumerator that specifies the type of Pascal Triangle: Positive or Negative.

Definition at line 60 of file AuxPascal.h.

Constructor & Destructor Documentation

◆ AuxPascal()

AuxPort::AuxPascal::AuxPascal ( )

Definition at line 4 of file AuxPascal.cpp.

Member Function Documentation

◆ computePascalTriangle()

std::vector< std::vector< float > > AuxPort::AuxPascal::computePascalTriangle ( uint32 N,
const Type & type = Type::Positive )

Computes N'th rows of the pascal triangle and returns a 2-D vector of floats.

Parameters
NNumber of rows to be computed in the pascal triangle
typeType of Pascal Triangle (Positive or Negative)

Definition at line 13 of file AuxPascal.cpp.

◆ Log()

void AuxPort::AuxPascal::Log ( )
overridevirtual

Logs the computed Pascal Triangle.

Reimplemented from AuxPort::ILog.

Definition at line 41 of file AuxPascal.cpp.

◆ logFileInfo()

void AuxPort::AuxPascal::logFileInfo ( )

Logs the info of last file that was read/written.

Definition at line 158 of file AuxPascal.cpp.

◆ readFromFile()

void AuxPort::AuxPascal::readFromFile ( const std::string & fileName)

Reads and loads coefficients of pascal triangle from a textfile.

Definition at line 94 of file AuxPascal.cpp.

◆ writeToFile()

void AuxPort::AuxPascal::writeToFile ( const std::string & fileName)

Writes the computed Pascal Triangle into a textfile.

Definition at line 62 of file AuxPascal.cpp.


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