1 #ifndef __GF256_POLY_H__
2 #define __GF256_POLY_H__
8 * Created by Christian Brunschen on 05/05/2008.
9 * Copyright 2008 Google UK. All rights reserved.
11 * Licensed under the Apache License, Version 2.0 (the "License");
12 * you may not use this file except in compliance with the License.
13 * You may obtain a copy of the License at
15 * http://www.apache.org/licenses/LICENSE-2.0
17 * Unless required by applicable law or agreed to in writing, software
18 * distributed under the License is distributed on an "AS IS" BASIS,
19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
20 * See the License for the specific language governing permissions and
21 * limitations under the License.
25 #include "../Counted.h"
28 using namespace common;
30 namespace reedsolomon {
33 class GF256Poly : public Counted {
36 ArrayRef<int> coefficients;
37 void fixCoefficients();
39 GF256Poly(GF256 &field, ArrayRef<int> c);
44 int getCoefficient(int degree);
45 int evaluateAt(int a);
46 GF256Poly *addOrSubtract(GF256Poly *other);
47 GF256Poly *multiply(GF256Poly *other);
48 GF256Poly *multiply(int scalar);
49 GF256Poly *multiplyByMonomial(int degree,
51 const char *description() const;
52 friend ostream& operator<<(ostream& out, const GF256Poly& poly);
57 #endif // __GF256_POLY_H__