Documentation
¶
Overview ¶
Copyright © 2021 Brian Longmore branodev@gmail.com
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
- func CheckMatSizes(mats ...Matrix) error
- func IsMultPossible(m1, m2 Matrix) bool
- func MatToString(mat Matrix) string
- func PrintMat(mat Matrix) (n int, err error)
- type MatPopConfig
- type Matrix
- func GetMatFromFile(path string) (Matrix, error)
- func GetMatsFromFiles(paths []string) ([]Matrix, error)
- func GetMinor(m Matrix, row, c int) Matrix
- func InitMat(rows, cols int) Matrix
- func MakeIdentityMat(w int) Matrix
- func ParseCmdArgs(cmd *cobra.Command, args []string) ([]Matrix, error)
- func PopulateNewMat(c MatPopConfig) Matrix
- func StringToMat(ms string) (Matrix, error)
- func StringsToMats(mats []string) ([]Matrix, error)
- type Row
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckMatSizes ¶ added in v1.1.0
CheckMatSizes checks if all mats are the same size.
func IsMultPossible ¶
IsMultPossible checks if multiplication between m1 and m2 is possible.
func MatToString ¶ added in v1.2.0
MatToString returns mat in its string form.
Types ¶
type MatPopConfig ¶ added in v1.0.0
type Matrix ¶
type Matrix []Row
func GetMatFromFile ¶
GetMatFromFile returns a matrix from a matrix file.
func GetMatsFromFiles ¶
GetMatsFromFiles returns a slice of matrices from their matrix files.
func InitMat ¶ added in v1.0.0
InitMat creates an empty matrix with the passed size. Main purpose is to init matrix that can later be populated with PopulateNewMat.
func MakeIdentityMat ¶ added in v1.6.0
MakeIdentityMat creates an indentity matrix with wid as the number of rows and cols.
func ParseCmdArgs ¶ added in v1.3.0
ParseCmdArgs parses args according to the command raw-input flag.
func PopulateNewMat ¶
func PopulateNewMat(c MatPopConfig) Matrix
PopulateNewMat creates and fills a new matrix according to the action performed on each element of the passed matrices and configurations. Omit NewRows and NewCols fields in c if you want them to be the same as the rows and cols of MainMat.
func StringToMat ¶ added in v1.2.0
StringToMat parses a string to a matrix.
func StringsToMats ¶ added in v1.3.0
StringsToMats parses strings to matrices.