Microsoft.Research.Science.Data.NetCDF4.ChunkSizeSelector.Log2m(uint)

Here are the examples of the csharp api class Microsoft.Research.Science.Data.NetCDF4.ChunkSizeSelector.Log2m(uint) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Example 7

1. Example

Project: SDSlite
Source File: ChunkSizeSelector.cs
public static int GetChunkSize(Type type, int rank)
        {
            int sizeBytes = GetSizeOfType(type);
            int s = Log2m((uint)sizeBytes);
            for (int n = suggestedChunkPower; n <= maxAllowedChunkPower; n++)
            {
                if (n <= s) continue;
                int p = (n - s) / rank;
                if (p * rank == n - s) return Pow(p);
            }
            for (int n = suggestedChunkPower - 1; n > s; n--)
            {
                int p = (n - s) / rank;
                if (p * rank == n - s) return Pow(p);
            }
            return 1;
        }