foldLeft initialization with class object iterator

When working on the code, I faced the following problem, I could not find a way which statement needs to be taken place when initiating foldleft statement with iterator of object class.Could you describe a solution on how to use foldLeft function with iterator of created instances. i tried to initiate this statement with empty object constructor but it does not make any sense. Thanks

def cgIterator(A:CSCMatrix[Double],b:DenseVector[Double],
initial:Iterator[stateofConjugateGradient],f:Iterable[(CSCMatrix[Double],
DenseVector[Double],stateofConjugateGradient)=>
stateofConjugateGradient]):={
Iterable[stateofConjugateGradient]={
f.map(cgIterator(A,b,initial,_))
}

def cgIterator(A:CSCMatrix[Double],
b:DenseVector[Double],
initial:Iterator[stateofConjugateGradient],f:
(CSCMatrix[Double],DenseVector[Double],
stateofConjugateGradient)=>stateofConjugateGradient):
stateofConjugateGradient={
initial.foldLeft(stateofConjugateGradient()){
case(x)=>f(A,b,x)}}

Compiling 1 Scala source to /home/gultugce/conjugategradient/target/scala-
2.12/classes …
[error]
/home/gultugce/conjugategradient
/src/main/scala/example/conjugateGradient.scala:54:44:
not enough arguments for method
apply: (xInit: breeze.linalg.DenseVector[Double], y:
breeze.linalg.DenseVector[Double], x:
breeze.linalg.DenseVector[Double])conjugateGradient.stateofConjugateGradient in
object
stateofConjugateGradient.
[error] Unspecified value parameters xInit, y, x.
[error] initial.foldLeft(stateofConjugateGradient()){case(x)=>f(A,b,x)}
[error] ^
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 21 s, completed Dec 15, 2021, 6:32:26 PM