Ejemplo n.º 1
0
        public override ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y)
        {
            LongArray ax = this.x, bx = ((F2mFieldElement)b).x, xx = ((F2mFieldElement)x).x, yx = ((F2mFieldElement)y).x;

            LongArray ab = ax.Multiply(bx, m, ks);
            LongArray xy = xx.Multiply(yx, m, ks);

            if (ab == ax || ab == bx)
            {
                ab = (LongArray)ab.Copy();
            }

            ab.AddShiftedByWords(xy, 0);
            ab.Reduce(m, ks);

            return(new F2mFieldElement(m, ks, ab));
        }
Ejemplo n.º 2
0
        public override ECFieldElement SquarePlusProduct(ECFieldElement x, ECFieldElement y)
        {
            LongArray ax = this.x, xx = ((F2mFieldElement)x).x, yx = ((F2mFieldElement)y).x;

            LongArray aa = ax.Square(m, ks);
            LongArray xy = xx.Multiply(yx, m, ks);

            if (aa == ax)
            {
                aa = (LongArray)aa.Copy();
            }

            aa.AddShiftedByWords(xy, 0);
            aa.Reduce(m, ks);

            return(new F2mFieldElement(m, ks, aa));
        }
Ejemplo n.º 3
0
    public override ECFieldElement MultiplyPlusProduct(ECFieldElement b, ECFieldElement x, ECFieldElement y)
    {
        LongArray longArray  = this.x;
        LongArray longArray2 = ((F2mFieldElement)b).x;
        LongArray longArray3 = ((F2mFieldElement)x).x;
        LongArray other      = ((F2mFieldElement)y).x;
        LongArray longArray4 = longArray.Multiply(longArray2, m, ks);
        LongArray other2     = longArray3.Multiply(other, m, ks);

        if (longArray4 == longArray || longArray4 == longArray2)
        {
            longArray4 = longArray4.Copy();
        }
        longArray4.AddShiftedByWords(other2, 0);
        longArray4.Reduce(m, ks);
        return(new F2mFieldElement(m, ks, longArray4));
    }
Ejemplo n.º 4
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test public void shouldPickFirstAvailableCandidateLongArrayWhenSomeDontHaveEnoughMemory()
        public virtual void ShouldPickFirstAvailableCandidateLongArrayWhenSomeDontHaveEnoughMemory()
        {
            // GIVEN
            NumberArrayFactory lowMemoryFactory = mock(typeof(NumberArrayFactory));

            doThrow(typeof(System.OutOfMemoryException)).when(lowMemoryFactory).newLongArray(anyLong(), anyLong(), anyLong());
            NumberArrayFactory factory = new NumberArrayFactory_Auto(NO_MONITOR, lowMemoryFactory, NumberArrayFactory.HEAP);

            // WHEN
            LongArray array = factory.NewLongArray(KILO, -1);

            array.Set(KILO - 10, 12345);

            // THEN
            verify(lowMemoryFactory, times(1)).newLongArray(KILO, -1, 0);
            assertTrue(array is HeapLongArray);
            assertEquals(12345, array.Get(KILO - 10));
        }
Ejemplo n.º 5
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @TestFactory Stream<org.junit.jupiter.api.DynamicTest> shouldHandleSomeRandomSetAndGet()
        internal virtual Stream <DynamicTest> ShouldHandleSomeRandomSetAndGet()
        {
            ThrowingConsumer <NumberArrayFactory> arrayFactoryConsumer = factory =>
            {
                int  length       = _random.Next(100_000) + 100;
                long defaultValue = _random.Next(2) - 1;                   // 0 or -1
                using (LongArray array = factory.newLongArray(length, defaultValue))
                {
                    long[] expected = new long[length];
                    Arrays.Fill(expected, defaultValue);

                    // WHEN
                    int operations = _random.Next(1_000) + 10;
                    for (int i = 0; i < operations; i++)
                    {
                        // THEN
                        int  index = _random.Next(length);
                        long value = _random.nextLong();
                        switch (_random.Next(3))
                        {
                        case 0:                           // set
                            array.Set(index, value);
                            expected[index] = value;
                            break;

                        case 1:                           // get
                            assertEquals(expected[index], array.Get(index), "Seed:" + _seed);
                            break;

                        default:                           // swap
                            int toIndex = _random.Next(length);
                            array.Swap(index, toIndex);
                            Swap(expected, index, toIndex);
                            break;
                        }
                    }
                }
            };

            return(stream(ArrayFactories(), NumberArrayFactoryName, arrayFactoryConsumer));
        }
Ejemplo n.º 6
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = Id;
         hashCode = (hashCode * 397) ^ NullableId.GetHashCode();
         hashCode = (hashCode * 397) ^ Byte.GetHashCode();
         hashCode = (hashCode * 397) ^ Short.GetHashCode();
         hashCode = (hashCode * 397) ^ Int;
         hashCode = (hashCode * 397) ^ Long.GetHashCode();
         hashCode = (hashCode * 397) ^ UShort.GetHashCode();
         hashCode = (hashCode * 397) ^ (int)UInt;
         hashCode = (hashCode * 397) ^ ULong.GetHashCode();
         hashCode = (hashCode * 397) ^ Float.GetHashCode();
         hashCode = (hashCode * 397) ^ Double.GetHashCode();
         hashCode = (hashCode * 397) ^ Decimal.GetHashCode();
         hashCode = (hashCode * 397) ^ (String != null ? String.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ DateTime.GetHashCode();
         hashCode = (hashCode * 397) ^ TimeSpan.GetHashCode();
         hashCode = (hashCode * 397) ^ DateTimeOffset.GetHashCode();
         hashCode = (hashCode * 397) ^ Guid.GetHashCode();
         hashCode = (hashCode * 397) ^ Bool.GetHashCode();
         hashCode = (hashCode * 397) ^ Char.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableDateTime.GetHashCode();
         hashCode = (hashCode * 397) ^ NullableTimeSpan.GetHashCode();
         hashCode = (hashCode * 397) ^ (ByteArray != null ? ByteArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CharArray != null ? CharArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StringArray != null ? StringArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IntArray != null ? IntArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (LongArray != null ? LongArray.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StringList != null ? StringList.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (StringMap != null ? StringMap.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (IntStringMap != null ? IntStringMap.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SubType != null ? SubType.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (SubTypes != null ? SubTypes.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (CustomText != null ? CustomText.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (MaxText != null ? MaxText.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ CustomDecimal.GetHashCode();
         return(hashCode);
     }
 }
Ejemplo n.º 7
0
    public LongArray GetCurrentFriendPageArray()
    {
        int totalPage = FriendPageCount;

        if (m_curFriendPage < 0 || m_curFriendPage >= totalPage)
        {
            DebugConsole.Log("Invalid friend page index." + m_curFriendPage);
            m_curFriendPage = 0;
        }

        LongArray la = new LongArray();

        for (int i = 0; i < Constants.PageItemCount; ++i)
        {
            int idx = m_curFriendPage * Constants.PageItemCount + i;
            if (idx >= m_friendArray.Data.Count)
            {
                break;
            }
            la.Data.Add(m_friendArray.Data[idx]);
        }
        return(la);
    }
Ejemplo n.º 8
0
 protected bool Equals(AllTypes other)
 {
     return(Id == other.Id &&
            NullableId == other.NullableId &&
            Byte == other.Byte &&
            Short == other.Short &&
            Int == other.Int &&
            Long == other.Long &&
            UShort == other.UShort &&
            UInt == other.UInt &&
            ULong == other.ULong &&
            Float.Equals(other.Float) &&
            Double.Equals(other.Double) &&
            Decimal == other.Decimal &&
            string.Equals(String, other.String) &&
            DateTime.Equals(other.DateTime) &&
            TimeSpan.Equals(other.TimeSpan) &&
            DateTimeOffset.Equals(other.DateTimeOffset) &&
            Guid.Equals(other.Guid) &&
            Bool == other.Bool &&
            Char == other.Char &&
            NullableDateTime.Equals(other.NullableDateTime) &&
            NullableTimeSpan.Equals(other.NullableTimeSpan) &&
            ByteArray.SequenceEqual(other.ByteArray) &&
            CharArray.SequenceEqual(other.CharArray) &&
            IntArray.SequenceEqual(other.IntArray) &&
            LongArray.SequenceEqual(other.LongArray) &&
            StringArray.SequenceEqual(other.StringArray) &&
            StringList.SequenceEqual(other.StringList) &&
            StringMap.SequenceEqual(other.StringMap) &&
            IntStringMap.SequenceEqual(other.IntStringMap) &&
            SubType.Equals(other.SubType) &&
            SubTypes.SequenceEqual(other.SubTypes) &&
            CustomText == other.CustomText &&
            MaxText == other.MaxText &&
            CustomDecimal.Equals(other.CustomDecimal));
 }
Ejemplo n.º 9
0
        private void VerifyBehaviour(LongArray array)
        {
            // insert
            for (int i = 0; i < COUNT; i++)
            {
                array.Set(i, i);
            }

            // verify inserted data
            for (int i = 0; i < COUNT; i++)
            {
                assertEquals(i, array.Get(i));
            }

            // verify inserted data with random access patterns
            int stride = 12_345_678;
            int next   = _random.Next(COUNT);

            for (int i = 0; i < COUNT; i++)
            {
                assertEquals(next, array.Get(next));
                next = (next + stride) % COUNT;
            }
        }
 IList <SecuredPathInfo> IPlasticAPI.GetSecuredPaths(string server, RepId repId, string path, string tag, LongArray brIds)
 {
     throw new NotImplementedException();
 }
Ejemplo n.º 11
0
    // Update is called once per frame
    void Update()
    {
        if (Input.GetKeyUp(KeyCode.Escape))
        {
            if (DialogBase.Actived())
            {
                DebugConsole.Log("Hide");
                DialogBase.Hide();
            }
            else
            {
                DebugConsole.Log("Show");
                DialogBase.Show("ESC", "Are you sure to exit game?", QuitGame);
            }
        }

        if (m_broadcastMsg != "")
        {
            // 有系统消息,平移吧
            GameObject goBroadcast = GameObject.Find("BroadcastText");
            Vector3    pos         = goBroadcast.transform.localPosition;
            pos.x -= 50 * Time.deltaTime;
            goBroadcast.transform.localPosition = pos;

            // 从600~-600
            if (goBroadcast.transform.localPosition.x < -600)
            {
                m_broadcastMsg = "";
            }
        }
        else
        {
            m_broadcastMsg = Lobby.getInstance().GetBroadcast();
            if (m_broadcastMsg != "")
            {
                GameObject goBroadcast = GameObject.Find("BroadcastText");
                goBroadcast.GetComponent <Text>().text = m_broadcastMsg;
                goBroadcast.transform.localPosition    = new Vector3(600, 0, 0);
            }
        }

        if (m_net == null || !m_net.IsRunning())
        {
            // 主动结束了
            return;
        }

        if (m_net.CheckReconnect())
        {
            CheckLogin();

            DialogReconnect.Hide();
        }

        ProtoPacket packet = new ProtoPacket();

        if (m_net.RecvTryDequeue(ref packet))
        {
            DebugConsole.Log("Reception handle cmdId:" + packet.cmdId);
            switch (packet.cmdId)
            {
            case Constants.Lion_QuickLoginInfo:
            {
                Lobby.getInstance().UserInfo = (LionUserInfo)packet.proto; // 更新LionUser
                m_login = true;
                UpdateUserInfoUI();                                        // 更新大厅主界面中信息
                if (packet.callback != null)
                {
                    packet.callback();
                }
            }
            break;

            case Constants.Lion_GetProfile:
            {
                LionUserInfo usrInfo = (LionUserInfo)packet.proto;        // 更新LionUser
                if (usrInfo.UserId == Lobby.getInstance().UId)
                {
                    Lobby.getInstance().UserInfo = usrInfo;
                }
                Lobby.getInstance().QueryUserInfo = usrInfo;

                if (packet.callback != null)
                {
                    // 通常这里显示个人信息对话框
                    packet.callback();
                }
            }
            break;

            case Constants.Lion_GetTigerStat:
            {
                Lobby.getInstance().TigerStatInfo = (TigerStat)packet.proto;
                if (packet.callback != null)
                {
                    packet.callback();
                }
            }
            break;

            case Constants.Lion_GetFriendRequests:
            case Constants.Lion_GetFriends:
            {
                Lobby.getInstance().FriendIDArray = (LongArray)packet.proto;
                if (packet.callback != null)
                {
                    GetFriendSummary(packet.callback);
                }
                else
                {
                    GetFriendSummary(ShowFriendsDlg);
                }
            }
            break;

            case Constants.Lion_GetFriendSummary:
            {
                Lobby.getInstance().CurrentSummaryList = (FriendSummaryList)packet.proto;
                DebugConsole.Log("Summary count:" + Lobby.getInstance().CurrentSummaryList.Data.Count);
                if (packet.callback != null)
                {
                    packet.callback();
                }
            }
            break;

            case Constants.Lion_IgnoreFriend:
            case Constants.Lion_AcceptFriend:
            case Constants.Lion_AddFriend:
            case Constants.Lion_DeleteFriend:
            {
                Status stat = (Status)packet.proto;
                if (stat.Code == 0)        // successful
                {
                    if (packet.callback != null)
                    {
                        packet.callback();
                    }
                }
                else
                {
                    DebugConsole.Log(stat.Desc);
                }
            }
            break;

            case Constants.Lion_Redirect:
            {
                Lobby.getInstance().RedirectInfo = (RedirectResp)packet.proto;
                // 切换到游戏场景中
                //m_net.Close();
                DebugConsole.Log("Reception enter slot scene");
                Global.NextSceneName = "slot";
                SceneManager.LoadScene("loading");
            }
            break;

            case Constants.Lion_UpdateProfile:
            {
                DebugConsole.Log("Lion_UpdateProfile");
                Status stat = (Status)packet.proto;
                if (stat.Code == 0)        // successful
                {
                    if (packet.callback != null)
                    {
                        packet.callback();
                    }
                }
                else
                {
                    DebugConsole.Log(stat.Desc);
                }
            }
            break;

            case Constants.Lion_NotifyWeeklyLogin:
            {
                // 连续登录奖励
                // NotifyWeeklyLogin 返回的intvalue是0-6,0表示今天登陆了(昨天没登录)
                IntValue iv = (IntValue)packet.proto;
                DialogDailyBonus.Show(iv.Value);

                //ExplodeCoin.Show();
            }
            break;

            case Constants.Lion_TakeLoginBonus:
            {
                LongArray la = (LongArray)packet.proto;
                // la[0] 奖励金币数
                // la[1] 最终总数
                if (la.Data.Count >= 2)
                {
                    Lobby.getInstance().UserInfo.Gold = la.Data[1];
                    // 若有动画,在此添加
                    JumpAndMoveCoins(6, UpdateUserInfoUI);
                }
            }
            break;

            case Constants.Lion_NotifyFreeBonus:
            {
                // 第一次登陆的时候,数据库里面没有数据,所以返回0
                // 后端推送,倒计时剩余时间长度(毫秒),如果小于等于0,直接显示奖励
                // 免费奖励
                LongValue lv       = (LongValue)packet.proto;
                long      curEpoch = (System.DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000;
                Lobby.getInstance().FreeBonusEpoch = curEpoch + lv.Value;
                UpdateCountDown();
            }
            break;

            case Constants.Lion_TakeFreeBonus:
            {
                LongArray la = (LongArray)packet.proto;
                if (la.Data.Count >= 2)
                {
                    Lobby.getInstance().UserInfo.Gold = la.Data[1];
                    // 若有动画,在此添加
                    FlyCoin(Constants.Bonus_Free);
                    UpdateUserInfoUI();
                }
            }
            break;

            case Constants.Lion_BuyItem:
            {
                Status stat = (Status)packet.proto;
                // 更新购买相关的:金币 or 背包
                DebugConsole.Log("Buy item return:" + stat.Code.ToString());
                if (stat.Code == 0)        // successful
                {
                    if (packet.callback != null)
                    {
                        packet.callback();
                    }
                }
                else
                {
                    DebugConsole.Log(stat.Desc);
                }
            }
            break;

            case Constants.Lion_Register:
            {
                Status stat = (Status)packet.proto;
                DebugConsole.Log("Register by email return:" + stat.Code.ToString());
                if (stat.Code == 0)        // successful
                {
                    if (packet.callback != null)
                    {
                        packet.callback();
                    }
                }
                else
                {
                    DebugConsole.Log(stat.Desc);
                    DialogBase.Show("Register by email", "Error:" + stat.Desc);
                }
            }
            break;

            case Constants.Lion_ModPass:
            {
                Status stat = (Status)packet.proto;
                DebugConsole.Log("Modify password return:" + stat.Code.ToString());
                if (stat.Code == 0)        // successful
                {
                    if (packet.callback != null)
                    {
                        packet.callback();
                    }
                }
                else
                {
                    DebugConsole.Log(stat.Desc);
                    DialogBase.Show("Modify password", "Error:" + stat.Desc);
                }
            }
            break;

            case Constants.Lion_RefreshGold:
            {
                LongValue lv = (LongValue)packet.proto;
                DebugConsole.Log("Refresh gold:" + lv.ToString());
                Lobby.getInstance().UserInfo.Gold = lv.Value;
                UpdateUserInfoUI();
            }
            break;

            case Constants.Lion_GetShopItems:
            {
                Lobby.getInstance().ShopList = (ShopList)packet.proto;
                DebugConsole.Log("ShopName:" + Lobby.getInstance().ShopList.ShopName);
                if (packet.callback != null)
                {
                    packet.callback();
                }
            }
            break;

            case Constants.Lion_BroadcastSystemMessage:
            {
                Tools.PlayNotification(Constants.Audio.Audio_Notification);
                StringValue sv = (StringValue)packet.proto;
                Lobby.getInstance().AddBroadcast(sv.Value);
            }
            break;

            case Constants.Lion_GetItems:
            {
                //
                Lobby.getInstance().UserItemList = (UserItemList)packet.proto;

                if (packet.callback != null)
                {
                    packet.callback();
                }
                else
                {
                    DialogBag.Show(null);
                }
            }
            break;

            case Constants.Reconnect:
            {
                // 展示重连对话框,直到重连成功
                if (packet.msgId == 1)
                {
                    ProtoNet.WriteLog("Reconnecting...");
                    // 3s后Display中重连
                    m_net.CheckReconnect(3);
                    DialogReconnect.Show();
                }
            }
            break;

            case Constants.Error:
            {
                // 展示错误
                Status stat = (Status)packet.proto;
                string err  = "Error:" + stat.Code.ToString() + "-" + stat.Desc;
                DialogBase.Show("ERROR", err);
            }
            break;

            default:
            {
                DebugConsole.Log("Reception invalid cmdId:" + packet.cmdId);
            }
            break;
            }
        }
    }
Ejemplo n.º 12
0
 public AtomicLongArray(LongArray arg0)
     : base(ProxyCtor.I)
 {
     Instance.CallConstructor("([J)V", arg0);
 }
Ejemplo n.º 13
0
 public override long[] MapLongArray(LongArray value)
 {
     return(value.AsObjectCopy());
 }
Ejemplo n.º 14
0
 internal FileRangeRacer(PageCacheLongArrayConcurrencyTest outerInstance, LongArray array, int contestant)
 {
     this._outerInstance = outerInstance;
     this.Array          = array;
     this.Contestant     = contestant;
 }
Ejemplo n.º 15
0
 internal WholeFileRacer(PageCacheLongArrayConcurrencyTest outerInstance, LongArray array)
 {
     this._outerInstance = outerInstance;
     this.Array          = array;
 }
        private byte[] QueryByExtentHandler(NameValueCollection boundVariables,
                                            JsonObject operationInput,
                                            string outputFormat,
                                            string requestProperties,
                                            out string responseProperties)
        {
            responseProperties = null;

            if (networkDataset == null)
            {
                throw new NullReferenceException("Could not access the network dataset.");
            }

            if (!operationInput.TryGetString("Extent", out var envelopeString))
            {
                throw new ArgumentNullException("Extent is invalid.");
            }
            var coords    = envelopeString.Split(';');
            var minCoords = coords[0].Split(',');
            var maxCoords = coords[1].Split(',');

            double.TryParse(minCoords[0].Trim(), out var minX);
            double.TryParse(minCoords[1].Trim(), out var minY);
            double.TryParse(maxCoords[0].Trim(), out var maxX);
            double.TryParse(maxCoords[0].Trim(), out var maxY);

            // Find features in envelope
            IEnvelope env = new EnvelopeClass();

            env.PutCoords(minX, minY, maxX, maxY);
            ISpatialFilter spatialFilter = new SpatialFilter();

            spatialFilter.Geometry   = env;
            spatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;

            // Add selected features OID into LongArray
            ILongArray     oIDs    = new LongArray();
            IFeatureCursor fCursor = streetFC.Search(spatialFilter, true);
            IFeature       feature = fCursor.NextFeature();

            while (feature != null)
            {
                oIDs.Add(feature.OID);
                feature = fCursor.NextFeature();
            }

            // Get the network edges corresponding to the streets and write out information about them

            INetworkQuery    networkQuery = networkDataset as INetworkQuery;
            INetworkJunction fromJunction =
                networkQuery.CreateNetworkElement(esriNetworkElementType.esriNETJunction) as INetworkJunction;
            INetworkJunction toJunction =
                networkQuery.CreateNetworkElement(esriNetworkElementType.esriNETJunction) as INetworkJunction;

            IEnumNetworkElement networkElements = networkQuery.ElementsByOIDs[streetsSourceID, oIDs];
            INetworkElement     networkElement  = networkElements.Next();
            JSONObject          result          = new JSONObject();
            JSONArray           elementArray    = new JSONArray();
            INetworkEdge        networkEdge;

            while (networkElement != null)
            {
                JSONObject jo = new JSONObject();
                networkEdge = networkElement as INetworkEdge;
                networkEdge.QueryJunctions(fromJunction, toJunction);
                double travelTime = (double)networkEdge.AttributeValue[travelTimeAttributeID];
                jo.AddLong("EdgeID", networkEdge.EID);
                jo.AddLong("FromJunctionID", fromJunction.EID);
                jo.AddLong("ToJunctionID", toJunction.EID);
                jo.AddDoubleEx(costAttributeName, travelTime, 4);
                elementArray.AddJSONObject(jo);
                networkElement = networkElements.Next();
            }
            result.AddJSONArray("NetworkElements", elementArray);

            return(Encoding.UTF8.GetBytes(result.ToJSONString(null)));
        }
Ejemplo n.º 17
0
        private static void serializeIjkGrid(DataObjectRepository repo)
        {
            AbstractIjkGridRepresentation ijkGrid = repo.createPartialIjkGridRepresentation("", "partial IJK Grid");

            f2i.energisticsStandardsApi.common.PropertyKind propertyKind = repo.createPartialPropertyKind("", "Partial prop kind");

            // creating the continuous Property with computing min max
            ContinuousProperty propertyCompute = repo.createContinuousProperty(
                ijkGrid, "9d0a717f-2cd3-4d43-9cbf-3484105ed384", "slab prop compute min max",
                1,
                resqml20__IndexableElements.resqml20__IndexableElements__cells,
                resqml20__ResqmlUom.resqml20__ResqmlUom__m,
                propertyKind);

            propertyCompute.pushBackFloatHdf5Array3dOfValues(2, 3, 4);

            ulong      valueCountInFastestDim = 2;
            ulong      valueCountInMiddleDim  = 3;
            ulong      valueCountInSlowestDim = 1;
            ulong      offsetInFastestDim     = 0;
            ulong      offsetInMiddleDim      = 0;
            ulong      offsetInSlowestDim     = 0;
            FloatArray kLayerValues           = new FloatArray(6);

            kLayerValues.setitem(0, -123.0f);
            kLayerValues.setitem(1, .01f);
            kLayerValues.setitem(2, .02f);
            kLayerValues.setitem(3, .03f);
            kLayerValues.setitem(4, .04f);
            kLayerValues.setitem(5, .05f);
            propertyCompute.setValuesOfFloatHdf5Array3dOfValues(kLayerValues.cast(), valueCountInFastestDim, valueCountInMiddleDim, valueCountInSlowestDim,
                                                                offsetInFastestDim, offsetInMiddleDim, offsetInSlowestDim);
            kLayerValues.setitem(0, .10f);
            kLayerValues.setitem(1, .11f);
            kLayerValues.setitem(2, .12f);
            kLayerValues.setitem(3, .13f);
            kLayerValues.setitem(4, .14f);
            kLayerValues.setitem(5, .15f);
            ++offsetInSlowestDim;
            propertyCompute.setValuesOfFloatHdf5Array3dOfValues(kLayerValues.cast(), valueCountInFastestDim, valueCountInMiddleDim, valueCountInSlowestDim,
                                                                offsetInFastestDim, offsetInMiddleDim, offsetInSlowestDim);
            kLayerValues.setitem(0, .20f);
            kLayerValues.setitem(1, .21f);
            kLayerValues.setitem(2, .22f);
            kLayerValues.setitem(3, float.NaN);
            kLayerValues.setitem(4, .24f);
            kLayerValues.setitem(5, .25f);
            ++offsetInSlowestDim;
            propertyCompute.setValuesOfFloatHdf5Array3dOfValues(kLayerValues.cast(), valueCountInFastestDim, valueCountInMiddleDim, valueCountInSlowestDim,
                                                                offsetInFastestDim, offsetInMiddleDim, offsetInSlowestDim);
            kLayerValues.setitem(0, .30f);
            kLayerValues.setitem(1, .31f);
            kLayerValues.setitem(2, .32f);
            kLayerValues.setitem(3, .33f);
            kLayerValues.setitem(4, .34f);
            kLayerValues.setitem(5, .35f);
            ++offsetInSlowestDim;
            propertyCompute.setValuesOfFloatHdf5Array3dOfValues(kLayerValues.cast(), valueCountInFastestDim, valueCountInMiddleDim, valueCountInSlowestDim,
                                                                offsetInFastestDim, offsetInMiddleDim, offsetInSlowestDim);
            GC.KeepAlive(kLayerValues);

            // creating the discrete Property with computing min max
            DiscreteProperty discretePropertyCompute = repo.createDiscreteProperty(
                ijkGrid, "50935c31-93ec-4084-8891-6e9f130c49c3", "testing discrete prop",
                1,
                resqml20__IndexableElements.resqml20__IndexableElements__cells,
                resqml20__ResqmlPropertyKind.resqml20__ResqmlPropertyKind__index);

            discretePropertyCompute.pushBackLongHdf5Array3dOfValues(2, 3, 4, 9999);

            offsetInSlowestDim = 0;
            LongArray kLayerlongValues = new LongArray(6);

            kLayerlongValues.setitem(0, -10);
            kLayerlongValues.setitem(1, 1);
            kLayerlongValues.setitem(2, 2);
            kLayerlongValues.setitem(3, 3);
            kLayerlongValues.setitem(4, 4);
            kLayerlongValues.setitem(5, 5);
            discretePropertyCompute.setValuesOfLongHdf5Array3dOfValues(kLayerlongValues.cast(), valueCountInFastestDim, valueCountInMiddleDim, valueCountInSlowestDim,
                                                                       offsetInFastestDim, offsetInMiddleDim, offsetInSlowestDim);
            kLayerlongValues.setitem(0, 10);
            kLayerlongValues.setitem(1, 11);
            kLayerlongValues.setitem(2, 12);
            kLayerlongValues.setitem(3, 13);
            kLayerlongValues.setitem(4, 14);
            kLayerlongValues.setitem(5, 15);
            ++offsetInSlowestDim;
            discretePropertyCompute.setValuesOfLongHdf5Array3dOfValues(kLayerlongValues.cast(), valueCountInFastestDim, valueCountInMiddleDim, valueCountInSlowestDim,
                                                                       offsetInFastestDim, offsetInMiddleDim, offsetInSlowestDim);
            kLayerlongValues.setitem(0, 20);
            kLayerlongValues.setitem(1, 21);
            kLayerlongValues.setitem(2, 22);
            kLayerlongValues.setitem(3, 9999);
            kLayerlongValues.setitem(4, 24);
            kLayerlongValues.setitem(5, 25);
            ++offsetInSlowestDim;
            discretePropertyCompute.setValuesOfLongHdf5Array3dOfValues(kLayerlongValues.cast(), valueCountInFastestDim, valueCountInMiddleDim, valueCountInSlowestDim,
                                                                       offsetInFastestDim, offsetInMiddleDim, offsetInSlowestDim);
            kLayerlongValues.setitem(0, 30);
            kLayerlongValues.setitem(1, 31);
            kLayerlongValues.setitem(2, 32);
            kLayerlongValues.setitem(3, 33);
            kLayerlongValues.setitem(4, 34);
            kLayerlongValues.setitem(5, 35);
            ++offsetInSlowestDim;
            discretePropertyCompute.setValuesOfLongHdf5Array3dOfValues(kLayerlongValues.cast(), valueCountInFastestDim, valueCountInMiddleDim, valueCountInSlowestDim,
                                                                       offsetInFastestDim, offsetInMiddleDim, offsetInSlowestDim);
            GC.KeepAlive(kLayerlongValues);
        }
Ejemplo n.º 18
0
 public LongCollisionValues(NumberArrayFactory factory, long length)
 {
     _cache = factory.NewLongArray(length, 0);
 }