Skip to content
Snippets Groups Projects
Commit d819af7a authored by Daniel Jankowski's avatar Daniel Jankowski
Browse files

Fixed: spelling errors and gitlab ci to go 1.12

parent 8880095a
No related branches found
No related tags found
No related merge requests found
......@@ -24,9 +24,8 @@ test:
# install the dependencies
- dep ensure
- mkdir report/
- export GOCACHE=off
# run the tests with coverage report
- go test -coverprofile report/cover.out -covermode=count ./...
- go test -count=1 -coverprofile report/cover.out -covermode=count ./...
# convert the coverage report to html and copy it back into the project directory
- go tool cover -html=report/cover.out -o report/cover.html
- cp -R report $CI_PROJECT_DIR/.
......@@ -52,7 +51,6 @@ lint:
# install the dependencies
- dep ensure
- mkdir report/
- export GOCACHE=off
# install golint
- go get -u golang.org/x/lint/golint
# run the tests with coverage report
......@@ -79,6 +77,5 @@ memory-sanitizer:
# install the dependencies
- dep ensure
- mkdir report/
- export GOCACHE=off
# run the tests with coverage report
- CC=clang go test -msan -short $(go list ./... | grep -v /vendor/)
\ No newline at end of file
- CC=clang go test -count=1 -msan -short $(go list ./... | grep -v /vendor/)
\ No newline at end of file
// Package gomatrix Is a go package for scientific operations with matrices in F2.
package gomatrix
import (
......@@ -43,7 +42,7 @@ func (f *F2) AddMatrix(m *F2) *F2 {
func (f *F2) MulMatrix(m *F2) *F2 {
// if the dimensions do not fit for a multiplication...
if f.N != m.M {
// ...retrun an error
// ...return an error
return nil
}
......@@ -96,26 +95,26 @@ func addBits(number *big.Int) uint {
return result
}
// PartialXor xors the bits from startCol to stopCol
// PartialXor xor's the bits from startCol to stopCol
//
// @param *big.Int x The base number to xor
// @param *big.Int y The number with the bits to xor
// @param int startCol The start index of the bitmask
// @param int stopCol The stop index of the bitmask
// @param int startCol The start index of the bit mask
// @param int stopCol The stop index of the bit mask
//
// @return *big.Int
func PartialXor(x, y *big.Int, startCol, stopCol int) *big.Int {
bitLength := stopCol - startCol
// create the bitmask
// create the bit mask
bitMask := big.NewInt(0).Exp(
big.NewInt(2), big.NewInt(int64(bitLength+1)), nil,
)
// decrease the bitmask by one
// decrease the bit mask by one
bitMask.Sub(bitMask, big.NewInt(1))
// shift the bitmask to the correct position
// shift the bit mask to the correct position
bitMask.Lsh(bitMask, uint(startCol))
// get the bits to xor
......
// Package gomatrix Is a go package for scientific operations with matrices in F2.
package gomatrix
// GaussianElimination converts the matrix to an echelon form
......
......@@ -9,7 +9,7 @@ import (
// F2 represents a matrix with entries that contains 0 or 1
//
// Each row consists of one big Int with arbitray size. Each column is one bit
// Each row consists of one big Int with arbitrary size. Each column is one bit
// at 2**(column_index) of the big Int in each row.
type F2 struct {
N int
......
// Package gomatrix Is a go package for scientific operations with matrices in F2.
package gomatrix
import (
......@@ -7,26 +6,26 @@ import (
// PrettyPrint prints the matrix to stdout
func (f *F2) PrettyPrint() {
f.printWithSeperators(" ", "\n")
f.printWithSeparators(" ", "\n")
}
// PrintLaTex prints the matrix as latex code
func (f *F2) PrintLaTex() {
fmt.Printf("\\begin{bmatrix}\n")
f.printWithSeperators(" & ", "\\\n")
f.printWithSeparators(" & ", "\\\n")
fmt.Printf("\\end{bmatrix}\n")
}
// PrintCSV prints the matrix as csv
func (f *F2) PrintCSV() {
f.printWithSeperators(", ", "\n")
f.printWithSeparators(", ", "\n")
}
// printWithSeperators prints the matrix with custom seperators
// printWithSeparators prints the matrix with custom seperators
//
// @param string valSep The seperator for the single values
// @param string lineSep The line seperator
func (f *F2) printWithSeperators(valSep, lineSep string) {
// @param string valSep The separator for the single values
// @param string lineSep The line separator
func (f *F2) printWithSeparators(valSep, lineSep string) {
for _, row := range f.Rows {
for i := 0; i < f.M; i++ {
if i == f.M-1 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment