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

This class can be used to express continuous mathematical functions as an infinite series of polynomial terms. More...

#include <AuxSeries.h>

Inheritance diagram for AuxPort::AuxSeries:
AuxPort::TextFile AuxPort::TextFormat AuxPort::File AuxPort::ILog AuxPort::ILog AuxPort::AuxSeriesEngine

Classes

struct  TaylorTerms
 TaylorTerms is a struct that represents a polynomial term's exponent and its coefficient. More...
 

Public Types

enum  Type {
  Sin , Cos , Sinh , Cosh ,
  Tanh , ArcTan , E , NaturalLog ,
  Undefined
}
 Type is used to specify the mathematical function, the class should compute the series for. More...
 

Public Member Functions

 AuxSeries (const AuxSeries &obj)=default
 
std::vector< TaylorTerms > & getTerms (uint32 N, const Type &type=Type::Sin)
 Computes the Taylor Series terms and returns a vector of those terms.
 
void computeTerms (uint32 N, const Type &type=Type::Sin)
 Computes Taylor Series terms and stores them in a vector internally.
 

Additional Inherited Members

- Protected Types inherited from AuxPort::File
enum  Mode { Idle = 0 , Read = 1 , Write = 2 }
 Easy way to specify the Read/Write behavior of the File Stream. More...
 
- Protected Member Functions inherited from AuxPort::TextFile
 TextFile ()=default
 Default Constructor, Initializes the TextFile API.
 
 ~TextFile ()=default
 Default Destructor.
 
std::string & readFileAsString ()
 Reads the entire text file and saves it in a String.
 
void writeLineToFile (const std::string &data, bool log=false)
 Writes a line to the Text File.
 
bool readLineFromFile (std::string &line, bool log=false)
 Reads a line to the Text File.
 
bool open (const std::string &fileName, const Mode &mode=Mode::Read, bool log=false) override
 Opens the given file as a text file.
 
bool close (bool log=false) override
 Closes current text file stream.
 
- Protected Member Functions inherited from AuxPort::File
 File (const File &file)=default
 
std::string getCurrentDirectory ()
 Returns the current directory, the program is running in.
 
std::vector< std::string > & getListOfFiles (const std::string &extension="")
 Returns list of files present in the current directory.
 
void Log () override
 Override this function to specify logging behavior.
 
- Protected Member Functions inherited from AuxPort::ILog
void setColour (const ColourType &colourType)
 This function allows you to set text colour for the text to be printed onto the console.
 
- Protected Member Functions inherited from AuxPort::TextFormat
 TextFormat (const TextFormat &textFormat)=default
 
void Log () override
 Implement this method in the derived class to specify logging behaviour.
 
std::string & getFormatName ()
 Return the format name.
 
std::string & getUniqueIdentifier ()
 Return the unique identifier for the text format.
 
std::string & getExtensionName ()
 Returns the extension name.
 
void setExtensionName (const std::string &extensionName)
 Sets the extension name.
 
void setUniqueIdentifier (const std::string &uniqueIdentifier)
 Sets the unique identifier for the text format.
 
void setFormatName (const std::string &formatName)
 Sets the format name.
 
virtual void read (std::string &line, int props=0)=0
 Implement this function to specify the read operation for the file.
 
virtual void write (const std::string &line, int props=0)=0
 Implement this function to specify the write operation for the file.
 
- Protected Attributes inherited from AuxPort::File
std::unique_ptr< std::ofstream > fileWriter
 
std::unique_ptr< std::ifstream > fileReader
 
std::string fileName
 
std::string fileExtension
 
std::string errorMessage
 
Mode mode
 
- Protected Attributes inherited from AuxPort::TextFormat
std::string formatName
 
std::string uniqueIdentifier
 
std::string extensionName
 

Detailed Description

This class can be used to express continuous mathematical functions as an infinite series of polynomial terms.

Definition at line 50 of file AuxSeries.h.

Member Enumeration Documentation

◆ Type

Type is used to specify the mathematical function, the class should compute the series for.

Definition at line 75 of file AuxSeries.h.

Constructor & Destructor Documentation

◆ AuxSeries()

AuxPort::AuxSeries::AuxSeries ( )

Definition at line 45 of file AuxSeries.cpp.

Member Function Documentation

◆ computeTerms()

void AuxPort::AuxSeries::computeTerms ( uint32 N,
const Type & type = Type::Sin )

Computes Taylor Series terms and stores them in a vector internally.

Parameters
NNumber of terms to compute
typeType of function for which we need to compute Taylor Teries terms

Definition at line 61 of file AuxSeries.cpp.

◆ getTerms()

std::vector< AuxPort::AuxSeries::TaylorTerms > & AuxPort::AuxSeries::getTerms ( uint32 N,
const Type & type = Type::Sin )

Computes the Taylor Series terms and returns a vector of those terms.

Parameters
NNumber of terms to compute
typeType of function for which we need to compute Taylor Teries terms

Definition at line 55 of file AuxSeries.cpp.


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