Basically. the question is simple.
Is there any algorithm so I can build a polynomial, orthogonal for the set of pre-defined polynomials? I need the algorithm(like Gram-Schmidt) that would be efficient to code.
Sorry if it is too easy, but I can't figure out.
EDIT: I guess I should add more information. Here is the whole problem
Currently I'm working with multiwavelet basis(need it for solving the stochastic ODE system as described here) and can't understand how to build it. Basically, I have a set of functions $p_{i} = x^{i}$ for $i = 0,\ldots,k -1$ and a set of piecewise functions $$ f_{i} = \begin{cases} p_{i}(x), & x\ge \frac{1}{2} \\ -p_{i}(x), & x\lt \frac{1}{2} \end{cases}$$ for $i = 0,\ldots,k -1$ Now, for each $f_{i}$ i have to build $$q_{i} = f_{i} + \sum_{i = 0}^{k - 1}\alpha_{ij}p_{i}(x)$$ that $\langle q_{i},p_{i} \rangle = 0$, where $$\langle f,g \rangle = \int_{0}^{1}f(x)g(x)dx$$ This operation is called "to orthogonalize $f_{i}$ with respect to set {$q_{i}(x), i = 0\ldots k - 1$}"
Basically, I don't know how to code this efficiently. I can use some kind of symbolic integration at Matlab, find all the scalar products and build a linear system of unknown $\alpha$ coefficients, but it seems completely inappropriate and inefficient for me. It is proposed in the original paper at page 249 to use Gram-Schmidt process for orthogonalizing, but as I understand this method builds new orthogonal base instead of orthogonalizing only one function with respect to others, aren't it?