convert this Go code to C++
"package main

import (
        "fmt"
)

type Simplex struct {
        function     []float64
        fm           []float64
        system       [][]float64
        sign         []int
        numV, numL   int
        way          bool
        funcValue    float64
        bv           [][]float64
        sv           [][]float64
        istr         []float64
        th           []float64
        iLrow, iLcol int
        alm          float64
}

func NewSimplex(A [][]float64, B []float64, function []float64, way bool) *Simplex {
        numL := len(A)
        numV := len(A[0])

        sign := make([]int, numL)
        for i := range sign {
                sign[i] = 0 // all <= type for simplicity
        }
        return &Simplex{
                function: function,
                fm:       B,
                system:   A,
                sign:     sign,
                numV:     numV,
                numL:     numL,
                way:      way,
        }
}

func (s *Simplex) Init() {
        s.funcValue = 0
        s.sv = make([][]float64, s.numL)
        for i := range s.sv {
                s.sv[i] = make([]float64, s.numV*2)
                for j := 0; j < s.numV; j++ {
                        s.sv[i][j] = s.system[i][j]
                }
                for j := s.numV; j < s.numV*2; j++ {
                        if (i+s.numV) == j {
                            if s.way{
                                s.sv[i][j] = 1
                            } else {
                                s.sv[i][j] = -1
                            }
                        } else {
                                s.sv[i][j] = 0
                        }
                }
        }
        s.istr = make([]float64, s.numV*2)
        s.bv = make([][]float64, s.numL)
        for i := range s.bv {
                s.bv[i] = make([]float64, 2)
                s.bv[i][0] = float64(i + s.numV)
                s.bv[i][1] = s.fm[i]
        }

        for i := 0; i < s.numV*2; i++ {
                if i < s.numV {
                        s.istr[i] = -s.function[i]
                } else {
                        s.istr[i] = 0
                }
        }

        s.iLcol = 0
        s.th = make([]float64, s.numL)
        for i := 0; i < s.numL; i++ {
                s.th[i] = s.bv[i][1] / s.sv[i][s.iLcol]
        }
        s.iLrow = 0
        for i := 0; i < s.numL-1; i++ {
                if s.th[i] > s.th[i+1] {
                        s.iLrow = i + 1
                }
        }
        s.alm = s.sv[s.iLrow][s.iLcol]
}

func (s *Simplex) PlaneIsValid() bool {
        for i := 0; i < s.numV*2; i++ {
                if s.way {
                        if s.istr[i] < 0 {
                                return false
                        }
                } else {
                        if s.istr[i] >= 0 {
                                return false
                        }
                }
        }
        return true
}

func (s *Simplex) FunctionIsUndefined() bool {
        for _, t := range s.th {
                if t < 0 {
                        return false
                }
        }
        return true
}

func (s *Simplex) GeneratePlane() {
        itNum := 0
        for !s.PlaneIsValid() && s.FunctionIsUndefined() {
                A := s.bv[s.iLrow][1]
                B := s.istr[s.iLcol]
                s.funcValue -= A * B / s.alm

                tmpBV := make([]float64, s.numL)
                s.bv[s.iLrow][0] = float64(s.iLcol)
                for i := 0; i < s.numL; i++ {
                        B := s.sv[i][s.iLcol]
                        tmpBV[i] = s.bv[s.iLrow][1]
                        if i != s.iLrow {
                                tmpBV[i] = s.bv[i][1] - A*B/s.alm
                        } else {
                                tmpBV[i] /= s.alm
                        }
                }
                for i := 0; i < s.numL; i++ {
                        s.bv[i][1] = tmpBV[i]
                }
                tmpIstr := s.istr
                for i := 0; i < s.numV*2; i++ {
                        A := s.sv[s.iLrow][i]
                        tmpIstr[i] = s.istr[i] - A*B/s.alm
                }
                s.istr = tmpIstr

                tmpSV := make([][]float64, s.numL)
                for i := range tmpSV {
                        tmpSV[i] = make([]float64, s.numV*2)
                        for j := range tmpSV[i] {
                                tmpSV[i][j] = s.sv[i][j]
                                A := s.sv[s.iLrow][j]
                                B := s.sv[i][s.iLcol]
                                if i == s.iLrow {
                                        tmpSV[i][j] /= s.alm
                                } else {
                                        tmpSV[i][j] = s.sv[i][j] - A*B/s.alm
                                }
                        }
                }
                s.sv = tmpSV

                s.iLcol = 0
                for i := 0; i < s.numL; i++ {
                        s.th[i] = s.bv[i][1] / s.sv[i][s.iLcol]
                }
                s.iLrow = 0
                for i := 0; i < s.numL-1; i++ {
                        if s.th[i] > s.th[i+1] {
                                s.iLrow = i + 1
                        }
                }
                s.alm = s.sv[s.iLrow][s.iLcol]
                itNum++
        }

        if !s.FunctionIsUndefined() {
                fmt.Println("\nObjective function is unbounded, this problem has no solution\n")
        } else {
                fmt.Printf("\nf(x) = %.2f\n\n", s.funcValue)
                for _, v := range s.bv {
                        fmt.Printf("x%.0f = %.2f\n", v[0]+1, v[1])
                }
                fmt.Println("\nAll computations were written to file table.txt")
        }
}

func main() {
        A := [][]float64{
                {3, 2, -4},
                {2, 3, 3},
                {5, -3, 1},
        }
        B := []float64{3, 15, 14}
        function := []float64{3, 5, 4} // Objective function coefficients
        maximize := true               // true for max, false for min

        simplex := NewSimplex(A, B, function, maximize)
        simplex.Init()
        simplex.GeneratePlane()
}"