ContinueLib

This documentation is automatically generated by online-judge-tools/verification-helper

View the Project on GitHub Continue765/ContinueLib

:heavy_check_mark: linear_algebra/gf2/transpose.hpp

Depends on

Required by

Verified with

Code

#pragma once
#include <common.hpp>

namespace gf2 {

template <typename U>
vector<U> transpose(int n, int m, const vector<U>& a) {
    vector<U> b(m);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            if (a[i] >> j & U{1}) {
                b[j] |= U{1} << i;
            }
        }
    }
    return b;
}

}
Back to top page